Skip to content

Commit a36aa0f

Browse files
Jiri Slaby (SUSE)KAGA-KOKO
authored andcommitted
mfd: 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) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 8529e33 commit a36aa0f

21 files changed

+43
-55
lines changed

drivers/mfd/88pm860x-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ static int device_irq_init(struct pm860x_chip *chip,
624624
ret = -EBUSY;
625625
goto out;
626626
}
627-
irq_domain_add_legacy(node, nr_irqs, chip->irq_base, 0,
628-
&pm860x_irq_domain_ops, chip);
627+
irq_domain_create_legacy(of_fwnode_handle(node), nr_irqs, chip->irq_base, 0,
628+
&pm860x_irq_domain_ops, chip);
629629
chip->core_irq = i2c->irq;
630630
if (!chip->core_irq)
631631
goto out;

drivers/mfd/ab8500-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,9 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
580580
num_irqs = AB8500_NR_IRQS;
581581

582582
/* If ->irq_base is zero this will give a linear mapping */
583-
ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node,
584-
num_irqs, 0,
585-
&ab8500_irq_ops, ab8500);
583+
ab8500->domain = irq_domain_create_simple(of_fwnode_handle(ab8500->dev->of_node),
584+
num_irqs, 0,
585+
&ab8500_irq_ops, ab8500);
586586

587587
if (!ab8500->domain) {
588588
dev_err(ab8500->dev, "Failed to create irqdomain\n");

drivers/mfd/arizona-irq.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ int arizona_irq_init(struct arizona *arizona)
312312
flags |= arizona->pdata.irq_flags;
313313

314314
/* Allocate a virtual IRQ domain to distribute to the regmap domains */
315-
arizona->virq = irq_domain_add_linear(NULL, 2, &arizona_domain_ops,
316-
arizona);
315+
arizona->virq = irq_domain_create_linear(NULL, 2, &arizona_domain_ops, arizona);
317316
if (!arizona->virq) {
318317
dev_err(arizona->dev, "Failed to add core IRQ domain\n");
319318
ret = -EINVAL;

drivers/mfd/db8500-prcmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,9 +2607,9 @@ static int db8500_irq_init(struct device_node *np)
26072607
{
26082608
int i;
26092609

2610-
db8500_irq_domain = irq_domain_add_simple(
2611-
np, NUM_PRCMU_WAKEUPS, 0,
2612-
&db8500_irq_ops, NULL);
2610+
db8500_irq_domain = irq_domain_create_simple(of_fwnode_handle(np),
2611+
NUM_PRCMU_WAKEUPS, 0,
2612+
&db8500_irq_ops, NULL);
26132613

26142614
if (!db8500_irq_domain) {
26152615
pr_err("Failed to create irqdomain\n");

drivers/mfd/fsl-imx25-tsadc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev,
6565
struct mx25_tsadc *tsadc)
6666
{
6767
struct device *dev = &pdev->dev;
68-
struct device_node *np = dev->of_node;
6968
int irq;
7069

7170
irq = platform_get_irq(pdev, 0);
7271
if (irq < 0)
7372
return irq;
7473

75-
tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,
76-
tsadc);
74+
tsadc->domain = irq_domain_create_simple(of_fwnode_handle(dev->of_node), 2, 0,
75+
&mx25_tsadc_domain_ops, tsadc);
7776
if (!tsadc->domain) {
7877
dev_err(dev, "Failed to add irq domain\n");
7978
return -ENOMEM;

drivers/mfd/lp8788-irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ int lp8788_irq_init(struct lp8788 *lp, int irq)
161161
return -ENOMEM;
162162

163163
irqd->lp = lp;
164-
irqd->domain = irq_domain_add_linear(lp->dev->of_node, LP8788_INT_MAX,
164+
irqd->domain = irq_domain_create_linear(of_fwnode_handle(lp->dev->of_node), LP8788_INT_MAX,
165165
&lp8788_domain_ops, irqd);
166166
if (!irqd->domain) {
167167
dev_err(lp->dev, "failed to add irq domain err\n");

drivers/mfd/max8925-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,8 @@ static int max8925_irq_init(struct max8925_chip *chip, int irq,
682682
return -EBUSY;
683683
}
684684

685-
irq_domain_add_legacy(node, MAX8925_NR_IRQS, chip->irq_base, 0,
686-
&max8925_irq_domain_ops, chip);
685+
irq_domain_create_legacy(of_fwnode_handle(node), MAX8925_NR_IRQS, chip->irq_base, 0,
686+
&max8925_irq_domain_ops, chip);
687687

688688
/* request irq handler for pmic main irq*/
689689
chip->core_irq = irq;

drivers/mfd/max8997-irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ int max8997_irq_init(struct max8997_dev *max8997)
327327
true : false;
328328
}
329329

330-
domain = irq_domain_add_linear(NULL, MAX8997_IRQ_NR,
331-
&max8997_irq_domain_ops, max8997);
330+
domain = irq_domain_create_linear(NULL, MAX8997_IRQ_NR,
331+
&max8997_irq_domain_ops, max8997);
332332
if (!domain) {
333333
dev_err(max8997->dev, "could not create irq domain\n");
334334
return -ENODEV;

drivers/mfd/max8998-irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ int max8998_irq_init(struct max8998_dev *max8998)
230230
max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM1, 0xff);
231231
max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM2, 0xff);
232232

233-
domain = irq_domain_add_simple(NULL, MAX8998_IRQ_NR,
233+
domain = irq_domain_create_simple(NULL, MAX8998_IRQ_NR,
234234
max8998->irq_base, &max8998_irq_domain_ops, max8998);
235235
if (!domain) {
236236
dev_err(max8998->dev, "could not create irq domain\n");

drivers/mfd/mt6358-irq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ int mt6358_irq_init(struct mt6397_chip *chip)
272272
irqd->pmic_ints[i].en_reg_shift * j, 0);
273273
}
274274

275-
chip->irq_domain = irq_domain_add_linear(chip->dev->of_node,
276-
irqd->num_pmic_irqs,
277-
&mt6358_irq_domain_ops, chip);
275+
chip->irq_domain = irq_domain_create_linear(of_fwnode_handle(chip->dev->of_node),
276+
irqd->num_pmic_irqs,
277+
&mt6358_irq_domain_ops, chip);
278278
if (!chip->irq_domain) {
279279
dev_err(chip->dev, "Could not create IRQ domain\n");
280280
return -ENODEV;

0 commit comments

Comments
 (0)