irq_domain/powerpc: Use common irq_domain structure instead of irq_host
This patch drops the powerpc-specific irq_host structures and uses the common irq_domain strucutres defined in linux/irqdomain.h. It also fixes all the users to use the new structure names. Renaming irq_host to irq_domain has been discussed for a long time, and this patch is a step in the process of generalizing the powerpc virq code to be usable by all architecture. An astute reader will notice that this patch actually removes the irq_host structure instead of renaming it. This is because the irq_domain structure already exists in include/linux/irqdomain.h and has the needed data members. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Milton Miller <miltonm@bga.com> Tested-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
@@ -89,9 +89,9 @@ static struct irq_chip hlwd_pic = {
|
||||
*
|
||||
*/
|
||||
|
||||
static struct irq_host *hlwd_irq_host;
|
||||
static struct irq_domain *hlwd_irq_host;
|
||||
|
||||
static int hlwd_pic_map(struct irq_host *h, unsigned int virq,
|
||||
static int hlwd_pic_map(struct irq_domain *h, unsigned int virq,
|
||||
irq_hw_number_t hwirq)
|
||||
{
|
||||
irq_set_chip_data(virq, h->host_data);
|
||||
@@ -100,11 +100,11 @@ static int hlwd_pic_map(struct irq_host *h, unsigned int virq,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_host_ops hlwd_irq_host_ops = {
|
||||
static struct irq_domain_ops hlwd_irq_domain_ops = {
|
||||
.map = hlwd_pic_map,
|
||||
};
|
||||
|
||||
static unsigned int __hlwd_pic_get_irq(struct irq_host *h)
|
||||
static unsigned int __hlwd_pic_get_irq(struct irq_domain *h)
|
||||
{
|
||||
void __iomem *io_base = h->host_data;
|
||||
int irq;
|
||||
@@ -123,14 +123,14 @@ static void hlwd_pic_irq_cascade(unsigned int cascade_virq,
|
||||
struct irq_desc *desc)
|
||||
{
|
||||
struct irq_chip *chip = irq_desc_get_chip(desc);
|
||||
struct irq_host *irq_host = irq_get_handler_data(cascade_virq);
|
||||
struct irq_domain *irq_domain = irq_get_handler_data(cascade_virq);
|
||||
unsigned int virq;
|
||||
|
||||
raw_spin_lock(&desc->lock);
|
||||
chip->irq_mask(&desc->irq_data); /* IRQ_LEVEL */
|
||||
raw_spin_unlock(&desc->lock);
|
||||
|
||||
virq = __hlwd_pic_get_irq(irq_host);
|
||||
virq = __hlwd_pic_get_irq(irq_domain);
|
||||
if (virq != NO_IRQ)
|
||||
generic_handle_irq(virq);
|
||||
else
|
||||
@@ -155,9 +155,9 @@ static void __hlwd_quiesce(void __iomem *io_base)
|
||||
out_be32(io_base + HW_BROADWAY_ICR, 0xffffffff);
|
||||
}
|
||||
|
||||
struct irq_host *hlwd_pic_init(struct device_node *np)
|
||||
struct irq_domain *hlwd_pic_init(struct device_node *np)
|
||||
{
|
||||
struct irq_host *irq_host;
|
||||
struct irq_domain *irq_domain;
|
||||
struct resource res;
|
||||
void __iomem *io_base;
|
||||
int retval;
|
||||
@@ -177,20 +177,20 @@ struct irq_host *hlwd_pic_init(struct device_node *np)
|
||||
|
||||
__hlwd_quiesce(io_base);
|
||||
|
||||
irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, HLWD_NR_IRQS,
|
||||
&hlwd_irq_host_ops, -1);
|
||||
if (!irq_host) {
|
||||
pr_err("failed to allocate irq_host\n");
|
||||
irq_domain = irq_alloc_host(np, IRQ_DOMAIN_MAP_LINEAR, HLWD_NR_IRQS,
|
||||
&hlwd_irq_domain_ops, -1);
|
||||
if (!irq_domain) {
|
||||
pr_err("failed to allocate irq_domain\n");
|
||||
return NULL;
|
||||
}
|
||||
irq_host->host_data = io_base;
|
||||
irq_domain->host_data = io_base;
|
||||
|
||||
return irq_host;
|
||||
return irq_domain;
|
||||
}
|
||||
|
||||
unsigned int hlwd_pic_get_irq(void)
|
||||
{
|
||||
return __hlwd_pic_get_irq(hlwd_irq_host);
|
||||
return __hlwd_pic_get_irq(hlwd_irq_domain);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -200,7 +200,7 @@ unsigned int hlwd_pic_get_irq(void)
|
||||
|
||||
void hlwd_pic_probe(void)
|
||||
{
|
||||
struct irq_host *host;
|
||||
struct irq_domain *host;
|
||||
struct device_node *np;
|
||||
const u32 *interrupts;
|
||||
int cascade_virq;
|
||||
@@ -214,7 +214,7 @@ void hlwd_pic_probe(void)
|
||||
irq_set_handler_data(cascade_virq, host);
|
||||
irq_set_chained_handler(cascade_virq,
|
||||
hlwd_pic_irq_cascade);
|
||||
hlwd_irq_host = host;
|
||||
hlwd_irq_domain = host;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void hlwd_pic_probe(void)
|
||||
*/
|
||||
void hlwd_quiesce(void)
|
||||
{
|
||||
void __iomem *io_base = hlwd_irq_host->host_data;
|
||||
void __iomem *io_base = hlwd_irq_domain->host_data;
|
||||
|
||||
__hlwd_quiesce(io_base);
|
||||
}
|
||||
|
Reference in New Issue
Block a user