提交 6b0aea44 编写于 作者: M Milton Miller 提交者: Benjamin Herrenschmidt

powerpc/spider-pic: Get pic from chip_data instead of irq_map

Building on Grant's efforts to remove the irq_map array, this patch
moves spider-pics use of virq_to_host() to use irq_data_get_chip_data
and sets the irq chip data in the map call, like most other interrupt
controllers in powerpc.
Signed-off-by: NMilton Miller <miltonm@bga.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 da051980
...@@ -68,9 +68,9 @@ struct spider_pic { ...@@ -68,9 +68,9 @@ struct spider_pic {
}; };
static struct spider_pic spider_pics[SPIDER_CHIP_COUNT]; static struct spider_pic spider_pics[SPIDER_CHIP_COUNT];
static struct spider_pic *spider_virq_to_pic(unsigned int virq) static struct spider_pic *spider_irq_data_to_pic(struct irq_data *d)
{ {
return virq_to_host(virq)->host_data; return irq_data_get_irq_chip_data(d);
} }
static void __iomem *spider_get_irq_config(struct spider_pic *pic, static void __iomem *spider_get_irq_config(struct spider_pic *pic,
...@@ -81,7 +81,7 @@ static void __iomem *spider_get_irq_config(struct spider_pic *pic, ...@@ -81,7 +81,7 @@ static void __iomem *spider_get_irq_config(struct spider_pic *pic,
static void spider_unmask_irq(struct irq_data *d) static void spider_unmask_irq(struct irq_data *d)
{ {
struct spider_pic *pic = spider_virq_to_pic(d->irq); struct spider_pic *pic = spider_irq_data_to_pic(d);
void __iomem *cfg = spider_get_irq_config(pic, irqd_to_hwirq(d)); void __iomem *cfg = spider_get_irq_config(pic, irqd_to_hwirq(d));
out_be32(cfg, in_be32(cfg) | 0x30000000u); out_be32(cfg, in_be32(cfg) | 0x30000000u);
...@@ -89,7 +89,7 @@ static void spider_unmask_irq(struct irq_data *d) ...@@ -89,7 +89,7 @@ static void spider_unmask_irq(struct irq_data *d)
static void spider_mask_irq(struct irq_data *d) static void spider_mask_irq(struct irq_data *d)
{ {
struct spider_pic *pic = spider_virq_to_pic(d->irq); struct spider_pic *pic = spider_irq_data_to_pic(d);
void __iomem *cfg = spider_get_irq_config(pic, irqd_to_hwirq(d)); void __iomem *cfg = spider_get_irq_config(pic, irqd_to_hwirq(d));
out_be32(cfg, in_be32(cfg) & ~0x30000000u); out_be32(cfg, in_be32(cfg) & ~0x30000000u);
...@@ -97,7 +97,7 @@ static void spider_mask_irq(struct irq_data *d) ...@@ -97,7 +97,7 @@ static void spider_mask_irq(struct irq_data *d)
static void spider_ack_irq(struct irq_data *d) static void spider_ack_irq(struct irq_data *d)
{ {
struct spider_pic *pic = spider_virq_to_pic(d->irq); struct spider_pic *pic = spider_irq_data_to_pic(d);
unsigned int src = irqd_to_hwirq(d); unsigned int src = irqd_to_hwirq(d);
/* Reset edge detection logic if necessary /* Reset edge detection logic if necessary
...@@ -116,7 +116,7 @@ static void spider_ack_irq(struct irq_data *d) ...@@ -116,7 +116,7 @@ static void spider_ack_irq(struct irq_data *d)
static int spider_set_irq_type(struct irq_data *d, unsigned int type) static int spider_set_irq_type(struct irq_data *d, unsigned int type)
{ {
unsigned int sense = type & IRQ_TYPE_SENSE_MASK; unsigned int sense = type & IRQ_TYPE_SENSE_MASK;
struct spider_pic *pic = spider_virq_to_pic(d->irq); struct spider_pic *pic = spider_irq_data_to_pic(d);
unsigned int hw = irqd_to_hwirq(d); unsigned int hw = irqd_to_hwirq(d);
void __iomem *cfg = spider_get_irq_config(pic, hw); void __iomem *cfg = spider_get_irq_config(pic, hw);
u32 old_mask; u32 old_mask;
...@@ -171,6 +171,7 @@ static struct irq_chip spider_pic = { ...@@ -171,6 +171,7 @@ static struct irq_chip spider_pic = {
static int spider_host_map(struct irq_host *h, unsigned int virq, static int spider_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw) irq_hw_number_t hw)
{ {
irq_set_chip_data(virq, h->host_data);
irq_set_chip_and_handler(virq, &spider_pic, handle_level_irq); irq_set_chip_and_handler(virq, &spider_pic, handle_level_irq);
/* Set default irq type */ /* Set default irq type */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册