Skip to content

Commit 4b5e1d9

Browse files
Jiri Slaby (SUSE)KAGA-KOKO
authored andcommitted
PCI: Switch to irq_domain_create_linear()
irq_domain_add_linear() is going away as being obsolete now. Switch to the preferred irq_domain_create_linear(). That differs in the first parameter: It takes more generic struct fwnode_handle instead of struct device_node. Therefore, of_fwnode_handle() is added around the 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 and convert the new instance in dwc/pcie-amd-mdb.c ] 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 e9bf225 commit 4b5e1d9

21 files changed

+59
-71
lines changed

drivers/pci/controller/dwc/pci-dra7xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ static int dra7xx_pcie_init_irq_domain(struct dw_pcie_rp *pp)
359359

360360
irq_set_chained_handler_and_data(pp->irq, dra7xx_pcie_msi_irq_handler,
361361
pp);
362-
dra7xx->irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
363-
&intx_domain_ops, pp);
362+
dra7xx->irq_domain = irq_domain_create_linear(of_fwnode_handle(pcie_intc_node),
363+
PCI_NUM_INTX, &intx_domain_ops, pp);
364364
of_node_put(pcie_intc_node);
365365
if (!dra7xx->irq_domain) {
366366
dev_err(dev, "Failed to get a INTx IRQ domain\n");

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ static int ks_pcie_config_intx_irq(struct keystone_pcie *ks_pcie)
761761
ks_pcie);
762762
}
763763

764-
intx_irq_domain = irq_domain_add_linear(intc_np, PCI_NUM_INTX,
764+
intx_irq_domain = irq_domain_create_linear(of_fwnode_handle(intc_np), PCI_NUM_INTX,
765765
&ks_pcie_intx_irq_domain_ops, NULL);
766766
if (!intx_irq_domain) {
767767
dev_err(dev, "Failed to add irq domain for INTX irqs\n");

drivers/pci/controller/dwc/pcie-amd-mdb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ static int amd_mdb_pcie_init_irq_domains(struct amd_mdb_pcie *pcie,
290290
return -ENODEV;
291291
}
292292

293-
pcie->mdb_domain = irq_domain_add_linear(pcie_intc_node, 32,
294-
&event_domain_ops, pcie);
293+
pcie->mdb_domain = irq_domain_create_linear(of_fwnode_handle(pcie_intc_node), 32,
294+
&event_domain_ops, pcie);
295295
if (!pcie->mdb_domain) {
296296
err = -ENOMEM;
297297
dev_err(dev, "Failed to add MDB domain\n");
@@ -300,8 +300,8 @@ static int amd_mdb_pcie_init_irq_domains(struct amd_mdb_pcie *pcie,
300300

301301
irq_domain_update_bus_token(pcie->mdb_domain, DOMAIN_BUS_NEXUS);
302302

303-
pcie->intx_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
304-
&amd_intx_domain_ops, pcie);
303+
pcie->intx_domain = irq_domain_create_linear(of_fwnode_handle(pcie_intc_node),
304+
PCI_NUM_INTX, &amd_intx_domain_ops, pcie);
305305
if (!pcie->intx_domain) {
306306
err = -ENOMEM;
307307
dev_err(dev, "Failed to add INTx domain\n");

drivers/pci/controller/dwc/pcie-dw-rockchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ static int rockchip_pcie_init_irq_domain(struct rockchip_pcie *rockchip)
144144
return -EINVAL;
145145
}
146146

147-
rockchip->irq_domain = irq_domain_add_linear(intc, PCI_NUM_INTX,
148-
&intx_domain_ops, rockchip);
147+
rockchip->irq_domain = irq_domain_create_linear(of_fwnode_handle(intc), PCI_NUM_INTX,
148+
&intx_domain_ops, rockchip);
149149
of_node_put(intc);
150150
if (!rockchip->irq_domain) {
151151
dev_err(dev, "failed to get a INTx IRQ domain\n");

drivers/pci/controller/dwc/pcie-uniphier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int uniphier_pcie_config_intx_irq(struct dw_pcie_rp *pp)
279279
goto out_put_node;
280280
}
281281

282-
pcie->intx_irq_domain = irq_domain_add_linear(np_intc, PCI_NUM_INTX,
282+
pcie->intx_irq_domain = irq_domain_create_linear(of_fwnode_handle(np_intc), PCI_NUM_INTX,
283283
&uniphier_intx_domain_ops, pp);
284284
if (!pcie->intx_irq_domain) {
285285
dev_err(pci->dev, "Failed to get INTx domain\n");

drivers/pci/controller/mobiveil/pcie-mobiveil-host.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ static int mobiveil_allocate_msi_domains(struct mobiveil_pcie *pcie)
439439
struct mobiveil_msi *msi = &pcie->rp.msi;
440440

441441
mutex_init(&msi->lock);
442-
msi->dev_domain = irq_domain_add_linear(NULL, msi->num_of_vectors,
443-
&msi_domain_ops, pcie);
442+
msi->dev_domain = irq_domain_create_linear(NULL, msi->num_of_vectors,
443+
&msi_domain_ops, pcie);
444444
if (!msi->dev_domain) {
445445
dev_err(dev, "failed to create IRQ domain\n");
446446
return -ENOMEM;
@@ -461,12 +461,11 @@ static int mobiveil_allocate_msi_domains(struct mobiveil_pcie *pcie)
461461
static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
462462
{
463463
struct device *dev = &pcie->pdev->dev;
464-
struct device_node *node = dev->of_node;
465464
struct mobiveil_root_port *rp = &pcie->rp;
466465

467466
/* setup INTx */
468-
rp->intx_domain = irq_domain_add_linear(node, PCI_NUM_INTX,
469-
&intx_domain_ops, pcie);
467+
rp->intx_domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), PCI_NUM_INTX,
468+
&intx_domain_ops, pcie);
470469

471470
if (!rp->intx_domain) {
472471
dev_err(dev, "Failed to get a INTx IRQ domain\n");

drivers/pci/controller/pci-aardvark.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,9 +1456,8 @@ static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie)
14561456
raw_spin_lock_init(&pcie->msi_irq_lock);
14571457
mutex_init(&pcie->msi_used_lock);
14581458

1459-
pcie->msi_inner_domain =
1460-
irq_domain_add_linear(NULL, MSI_IRQ_NUM,
1461-
&advk_msi_domain_ops, pcie);
1459+
pcie->msi_inner_domain = irq_domain_create_linear(NULL, MSI_IRQ_NUM,
1460+
&advk_msi_domain_ops, pcie);
14621461
if (!pcie->msi_inner_domain)
14631462
return -ENOMEM;
14641463

@@ -1508,9 +1507,8 @@ static int advk_pcie_init_irq_domain(struct advk_pcie *pcie)
15081507
irq_chip->irq_mask = advk_pcie_irq_mask;
15091508
irq_chip->irq_unmask = advk_pcie_irq_unmask;
15101509

1511-
pcie->irq_domain =
1512-
irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
1513-
&advk_pcie_irq_domain_ops, pcie);
1510+
pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(pcie_intc_node), PCI_NUM_INTX,
1511+
&advk_pcie_irq_domain_ops, pcie);
15141512
if (!pcie->irq_domain) {
15151513
dev_err(dev, "Failed to get a INTx IRQ domain\n");
15161514
ret = -ENOMEM;
@@ -1549,9 +1547,7 @@ static const struct irq_domain_ops advk_pcie_rp_irq_domain_ops = {
15491547

15501548
static int advk_pcie_init_rp_irq_domain(struct advk_pcie *pcie)
15511549
{
1552-
pcie->rp_irq_domain = irq_domain_add_linear(NULL, 1,
1553-
&advk_pcie_rp_irq_domain_ops,
1554-
pcie);
1550+
pcie->rp_irq_domain = irq_domain_create_linear(NULL, 1, &advk_pcie_rp_irq_domain_ops, pcie);
15551551
if (!pcie->rp_irq_domain) {
15561552
dev_err(&pcie->pdev->dev, "Failed to add Root Port IRQ domain\n");
15571553
return -ENOMEM;

drivers/pci/controller/pci-ftpci100.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p)
345345
return irq ?: -EINVAL;
346346
}
347347

348-
p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX,
349-
&faraday_pci_irqdomain_ops, p);
348+
p->irqdomain = irq_domain_create_linear(of_fwnode_handle(intc), PCI_NUM_INTX,
349+
&faraday_pci_irqdomain_ops, p);
350350
of_node_put(intc);
351351
if (!p->irqdomain) {
352352
dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n");

drivers/pci/controller/pci-mvebu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,9 +1078,9 @@ static int mvebu_pcie_init_irq_domain(struct mvebu_pcie_port *port)
10781078
return -ENODEV;
10791079
}
10801080

1081-
port->intx_irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
1082-
&mvebu_pcie_intx_irq_domain_ops,
1083-
port);
1081+
port->intx_irq_domain = irq_domain_create_linear(of_fwnode_handle(pcie_intc_node),
1082+
PCI_NUM_INTX,
1083+
&mvebu_pcie_intx_irq_domain_ops, port);
10841084
of_node_put(pcie_intc_node);
10851085
if (!port->intx_irq_domain) {
10861086
dev_err(dev, "Failed to get INTx IRQ domain for %s\n", port->name);

drivers/pci/controller/pcie-altera-msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int altera_allocate_domains(struct altera_msi *msi)
166166
{
167167
struct fwnode_handle *fwnode = of_fwnode_handle(msi->pdev->dev.of_node);
168168

169-
msi->inner_domain = irq_domain_add_linear(NULL, msi->num_of_vectors,
169+
msi->inner_domain = irq_domain_create_linear(NULL, msi->num_of_vectors,
170170
&msi_domain_ops, msi);
171171
if (!msi->inner_domain) {
172172
dev_err(&msi->pdev->dev, "failed to create IRQ domain\n");

0 commit comments

Comments
 (0)