powerpc: Switch to irq_domain_create_*()
irq_domain_add_*() interfaces are going away as being obsolete now. Switch to the preferred irq_domain_create_*() ones. Those differ in the node parameter: They take more generic struct fwnode_handle instead of struct device_node. Therefore, of_fwnode_handle() is added around the original parameter. Note some of the users can likely use dev->fwnode directly instead of indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not guaranteed to be set for all, so this has to be investigated on case to case basis (by people who can actually test with the HW). [ tglx: Fix up subject prefix ] Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> # For 8xx Link: https://lore.kernel.org/all/20250319092951.37667-33-jirislaby@kernel.org
This commit is contained in:
committed by
Thomas Gleixner
parent
219182fe21
commit
bf9935e479
@@ -254,8 +254,9 @@ static struct uic * __init uic_init_one(struct device_node *node)
|
||||
}
|
||||
uic->dcrbase = *dcrreg;
|
||||
|
||||
uic->irqhost = irq_domain_add_linear(node, NR_UIC_INTS, &uic_host_ops,
|
||||
uic);
|
||||
uic->irqhost = irq_domain_create_linear(of_fwnode_handle(node),
|
||||
NR_UIC_INTS, &uic_host_ops,
|
||||
uic);
|
||||
if (! uic->irqhost)
|
||||
return NULL; /* FIXME: panic? */
|
||||
|
||||
|
||||
@@ -188,7 +188,8 @@ mpc5121_ads_cpld_pic_init(void)
|
||||
|
||||
cpld_pic_node = of_node_get(np);
|
||||
|
||||
cpld_pic_host = irq_domain_add_linear(np, 16, &cpld_pic_host_ops, NULL);
|
||||
cpld_pic_host = irq_domain_create_linear(of_fwnode_handle(np), 16,
|
||||
&cpld_pic_host_ops, NULL);
|
||||
if (!cpld_pic_host) {
|
||||
printk(KERN_ERR "CPLD PIC: failed to allocate irq host!\n");
|
||||
goto end;
|
||||
|
||||
@@ -168,7 +168,7 @@ static void __init media5200_init_irq(void)
|
||||
|
||||
spin_lock_init(&media5200_irq.lock);
|
||||
|
||||
media5200_irq.irqhost = irq_domain_add_linear(fpga_np,
|
||||
media5200_irq.irqhost = irq_domain_create_linear(of_fwnode_handle(fpga_np),
|
||||
MEDIA5200_NUM_IRQS, &media5200_irq_ops, &media5200_irq);
|
||||
if (!media5200_irq.irqhost)
|
||||
goto out;
|
||||
|
||||
@@ -247,9 +247,9 @@ mpc52xx_gpt_irq_setup(struct mpc52xx_gpt_priv *gpt, struct device_node *node)
|
||||
if (!cascade_virq)
|
||||
return;
|
||||
|
||||
gpt->irqhost = irq_domain_add_linear(node, 1, &mpc52xx_gpt_irq_ops, gpt);
|
||||
gpt->irqhost = irq_domain_create_linear(of_fwnode_handle(node), 1, &mpc52xx_gpt_irq_ops, gpt);
|
||||
if (!gpt->irqhost) {
|
||||
dev_err(gpt->dev, "irq_domain_add_linear() failed\n");
|
||||
dev_err(gpt->dev, "irq_domain_create_linear() failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -446,7 +446,7 @@ void __init mpc52xx_init_irq(void)
|
||||
* As last step, add an irq host to translate the real
|
||||
* hw irq information provided by the ofw to linux virq
|
||||
*/
|
||||
mpc52xx_irqhost = irq_domain_add_linear(picnode,
|
||||
mpc52xx_irqhost = irq_domain_create_linear(of_fwnode_handle(picnode),
|
||||
MPC52xx_IRQ_HIGHTESTHWIRQ,
|
||||
&mpc52xx_irqhost_ops, NULL);
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ void __init socrates_fpga_pic_init(struct device_node *pic)
|
||||
int i;
|
||||
|
||||
/* Setup an irq_domain structure */
|
||||
socrates_fpga_pic_irq_host = irq_domain_add_linear(pic,
|
||||
socrates_fpga_pic_irq_host = irq_domain_create_linear(of_fwnode_handle(pic),
|
||||
SOCRATES_FPGA_NUM_IRQS, &socrates_fpga_pic_host_ops, NULL);
|
||||
if (socrates_fpga_pic_irq_host == NULL) {
|
||||
pr_err("FPGA PIC: Unable to allocate host\n");
|
||||
|
||||
@@ -110,7 +110,8 @@ static int cpm_pic_probe(struct platform_device *pdev)
|
||||
|
||||
out_be32(&data->reg->cpic_cimr, 0);
|
||||
|
||||
data->host = irq_domain_add_linear(dev->of_node, 64, &cpm_pic_host_ops, data);
|
||||
data->host = irq_domain_create_linear(of_fwnode_handle(dev->of_node),
|
||||
64, &cpm_pic_host_ops, data);
|
||||
if (!data->host)
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
@@ -146,7 +146,8 @@ void __init mpc8xx_pic_init(void)
|
||||
if (!siu_reg)
|
||||
goto out;
|
||||
|
||||
mpc8xx_pic_host = irq_domain_add_linear(np, 64, &mpc8xx_pic_host_ops, NULL);
|
||||
mpc8xx_pic_host = irq_domain_create_linear(of_fwnode_handle(np), 64,
|
||||
&mpc8xx_pic_host_ops, NULL);
|
||||
if (!mpc8xx_pic_host)
|
||||
printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
|
||||
|
||||
|
||||
@@ -149,8 +149,9 @@ static struct irq_domain * __init flipper_pic_init(struct device_node *np)
|
||||
|
||||
__flipper_quiesce(io_base);
|
||||
|
||||
irq_domain = irq_domain_add_linear(np, FLIPPER_NR_IRQS,
|
||||
&flipper_irq_domain_ops, io_base);
|
||||
irq_domain = irq_domain_create_linear(of_fwnode_handle(np),
|
||||
FLIPPER_NR_IRQS,
|
||||
&flipper_irq_domain_ops, io_base);
|
||||
if (!irq_domain) {
|
||||
pr_err("failed to allocate irq_domain\n");
|
||||
return NULL;
|
||||
|
||||
@@ -175,8 +175,9 @@ static struct irq_domain *__init hlwd_pic_init(struct device_node *np)
|
||||
|
||||
__hlwd_quiesce(io_base);
|
||||
|
||||
irq_domain = irq_domain_add_linear(np, HLWD_NR_IRQS,
|
||||
&hlwd_irq_domain_ops, io_base);
|
||||
irq_domain = irq_domain_create_linear(of_fwnode_handle(np),
|
||||
HLWD_NR_IRQS,
|
||||
&hlwd_irq_domain_ops, io_base);
|
||||
if (!irq_domain) {
|
||||
pr_err("failed to allocate irq_domain\n");
|
||||
iounmap(io_base);
|
||||
|
||||
@@ -327,8 +327,9 @@ static void __init pmac_pic_probe_oldstyle(void)
|
||||
/*
|
||||
* Allocate an irq host
|
||||
*/
|
||||
pmac_pic_host = irq_domain_add_linear(master, max_irqs,
|
||||
&pmac_pic_host_ops, NULL);
|
||||
pmac_pic_host = irq_domain_create_linear(of_fwnode_handle(master),
|
||||
max_irqs,
|
||||
&pmac_pic_host_ops, NULL);
|
||||
BUG_ON(pmac_pic_host == NULL);
|
||||
irq_set_default_domain(pmac_pic_host);
|
||||
|
||||
|
||||
@@ -191,7 +191,8 @@ int __init opal_event_init(void)
|
||||
* fall back to the legacy method (opal_event_request(...))
|
||||
* anyway. */
|
||||
dn = of_find_compatible_node(NULL, NULL, "ibm,opal-event");
|
||||
opal_event_irqchip.domain = irq_domain_add_linear(dn, MAX_NUM_EVENTS,
|
||||
opal_event_irqchip.domain = irq_domain_create_linear(of_fwnode_handle(dn),
|
||||
MAX_NUM_EVENTS,
|
||||
&opal_event_domain_ops, &opal_event_irqchip);
|
||||
of_node_put(dn);
|
||||
if (!opal_event_irqchip.domain) {
|
||||
|
||||
@@ -259,7 +259,8 @@ void cpm2_pic_init(struct device_node *node)
|
||||
out_be32(&cpm2_intctl->ic_scprrl, 0x05309770);
|
||||
|
||||
/* create a legacy host */
|
||||
cpm2_pic_host = irq_domain_add_linear(node, 64, &cpm2_pic_host_ops, NULL);
|
||||
cpm2_pic_host = irq_domain_create_linear(of_fwnode_handle(node), 64,
|
||||
&cpm2_pic_host_ops, NULL);
|
||||
if (cpm2_pic_host == NULL) {
|
||||
printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
|
||||
return;
|
||||
|
||||
@@ -269,8 +269,9 @@ void __init ehv_pic_init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
ehv_pic->irqhost = irq_domain_add_linear(np, NR_EHV_PIC_INTS,
|
||||
&ehv_pic_host_ops, ehv_pic);
|
||||
ehv_pic->irqhost = irq_domain_create_linear(of_fwnode_handle(np),
|
||||
NR_EHV_PIC_INTS,
|
||||
&ehv_pic_host_ops, ehv_pic);
|
||||
if (!ehv_pic->irqhost) {
|
||||
of_node_put(np);
|
||||
kfree(ehv_pic);
|
||||
|
||||
@@ -412,7 +412,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
|
||||
}
|
||||
platform_set_drvdata(dev, msi);
|
||||
|
||||
msi->irqhost = irq_domain_add_linear(dev->dev.of_node,
|
||||
msi->irqhost = irq_domain_create_linear(of_fwnode_handle(dev->dev.of_node),
|
||||
NR_MSI_IRQS_MAX, &fsl_msi_host_ops, msi);
|
||||
|
||||
if (msi->irqhost == NULL) {
|
||||
|
||||
@@ -214,8 +214,9 @@ void __init gef_pic_init(struct device_node *np)
|
||||
}
|
||||
|
||||
/* Setup an irq_domain structure */
|
||||
gef_pic_irq_host = irq_domain_add_linear(np, GEF_PIC_NUM_IRQS,
|
||||
&gef_pic_host_ops, NULL);
|
||||
gef_pic_irq_host = irq_domain_create_linear(of_fwnode_handle(np),
|
||||
GEF_PIC_NUM_IRQS,
|
||||
&gef_pic_host_ops, NULL);
|
||||
if (gef_pic_irq_host == NULL)
|
||||
return;
|
||||
|
||||
|
||||
@@ -260,8 +260,8 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
|
||||
raw_spin_unlock_irqrestore(&i8259_lock, flags);
|
||||
|
||||
/* create a legacy host */
|
||||
i8259_host = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0,
|
||||
&i8259_host_ops, NULL);
|
||||
i8259_host = irq_domain_create_legacy(of_fwnode_handle(node), NR_IRQS_LEGACY, 0, 0,
|
||||
&i8259_host_ops, NULL);
|
||||
if (i8259_host == NULL) {
|
||||
printk(KERN_ERR "i8259: failed to allocate irq host !\n");
|
||||
return;
|
||||
|
||||
@@ -711,8 +711,9 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
|
||||
if (ipic == NULL)
|
||||
return NULL;
|
||||
|
||||
ipic->irqhost = irq_domain_add_linear(node, NR_IPIC_INTS,
|
||||
&ipic_host_ops, ipic);
|
||||
ipic->irqhost = irq_domain_create_linear(of_fwnode_handle(node),
|
||||
NR_IPIC_INTS,
|
||||
&ipic_host_ops, ipic);
|
||||
if (ipic->irqhost == NULL) {
|
||||
kfree(ipic);
|
||||
return NULL;
|
||||
|
||||
@@ -1483,9 +1483,9 @@ struct mpic * __init mpic_alloc(struct device_node *node,
|
||||
mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1);
|
||||
mpic->isu_mask = (1 << mpic->isu_shift) - 1;
|
||||
|
||||
mpic->irqhost = irq_domain_add_linear(mpic->node,
|
||||
intvec_top,
|
||||
&mpic_host_ops, mpic);
|
||||
mpic->irqhost = irq_domain_create_linear(of_fwnode_handle(mpic->node),
|
||||
intvec_top,
|
||||
&mpic_host_ops, mpic);
|
||||
|
||||
/*
|
||||
* FIXME: The code leaks the MPIC object and mappings here; this
|
||||
|
||||
@@ -404,8 +404,8 @@ void __init tsi108_pci_int_init(struct device_node *node)
|
||||
{
|
||||
DBG("Tsi108_pci_int_init: initializing PCI interrupts\n");
|
||||
|
||||
pci_irq_host = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0,
|
||||
&pci_irq_domain_ops, NULL);
|
||||
pci_irq_host = irq_domain_create_legacy(of_fwnode_handle(node), NR_IRQS_LEGACY, 0, 0,
|
||||
&pci_irq_domain_ops, NULL);
|
||||
if (pci_irq_host == NULL) {
|
||||
printk(KERN_ERR "pci_irq_host: failed to allocate irq domain!\n");
|
||||
return;
|
||||
|
||||
@@ -1464,7 +1464,7 @@ static const struct irq_domain_ops xive_irq_domain_ops = {
|
||||
|
||||
static void __init xive_init_host(struct device_node *np)
|
||||
{
|
||||
xive_irq_domain = irq_domain_add_tree(np, &xive_irq_domain_ops, NULL);
|
||||
xive_irq_domain = irq_domain_create_tree(of_fwnode_handle(np), &xive_irq_domain_ops, NULL);
|
||||
if (WARN_ON(xive_irq_domain == NULL))
|
||||
return;
|
||||
irq_set_default_domain(xive_irq_domain);
|
||||
|
||||
Reference in New Issue
Block a user