Skip to content

Commit caecb05

Browse files
kwilczynskibjorn-helgaas
authored andcommitted
PCI: Remove dev_err() when handing an error from platform_get_irq()
There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure. This change is as per suggestions from Coccinelle, e.g., drivers/pci/controller/dwc/pcie-armada8k.c:252:2-9: line 252 is redundant because platform_get_irq() already prints an error [bhelgaas: squashed into one commit] Suggested-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Ley Foon Tan <[email protected]> # altera Acked-by: Jesper Nilsson <[email protected]> # dwc
1 parent b3a9e3b commit caecb05

21 files changed

+29
-82
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -629,10 +629,8 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
629629
struct resource *res;
630630

631631
pp->irq = platform_get_irq(pdev, 1);
632-
if (pp->irq < 0) {
633-
dev_err(dev, "missing IRQ resource\n");
632+
if (pp->irq < 0)
634633
return pp->irq;
635-
}
636634

637635
ret = dra7xx_pcie_init_irq_domain(pp);
638636
if (ret < 0)
@@ -871,10 +869,8 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
871869
pci->ops = &dw_pcie_ops;
872870

873871
irq = platform_get_irq(pdev, 0);
874-
if (irq < 0) {
875-
dev_err(dev, "missing IRQ resource: %d\n", irq);
872+
if (irq < 0)
876873
return irq;
877-
}
878874

879875
base = devm_platform_ioremap_resource_byname(pdev, "ti_conf");
880876
if (IS_ERR(base))

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,9 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
402402
int ret;
403403

404404
pp->irq = platform_get_irq(pdev, 1);
405-
if (pp->irq < 0) {
406-
dev_err(dev, "failed to get irq\n");
405+
if (pp->irq < 0)
407406
return pp->irq;
408-
}
407+
409408
ret = devm_request_irq(dev, pp->irq, exynos_pcie_irq_handler,
410409
IRQF_SHARED, "exynos-pcie", ep);
411410
if (ret) {
@@ -415,10 +414,8 @@ static int __init exynos_add_pcie_port(struct exynos_pcie *ep,
415414

416415
if (IS_ENABLED(CONFIG_PCI_MSI)) {
417416
pp->msi_irq = platform_get_irq(pdev, 0);
418-
if (pp->msi_irq < 0) {
419-
dev_err(dev, "failed to get msi irq\n");
417+
if (pp->msi_irq < 0)
420418
return pp->msi_irq;
421-
}
422419
}
423420

424421
pp->ops = &exynos_pcie_host_ops;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,10 +868,8 @@ static int imx6_add_pcie_port(struct imx6_pcie *imx6_pcie,
868868

869869
if (IS_ENABLED(CONFIG_PCI_MSI)) {
870870
pp->msi_irq = platform_get_irq_byname(pdev, "msi");
871-
if (pp->msi_irq < 0) {
872-
dev_err(dev, "failed to get MSI irq\n");
871+
if (pp->msi_irq < 0)
873872
return pp->msi_irq;
874-
}
875873
}
876874

877875
pp->ops = &imx6_pcie_host_ops;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,10 +1250,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
12501250
pci->version = version;
12511251

12521252
irq = platform_get_irq(pdev, 0);
1253-
if (irq < 0) {
1254-
dev_err(dev, "missing IRQ resource: %d\n", irq);
1253+
if (irq < 0)
12551254
return irq;
1256-
}
12571255

12581256
ret = request_irq(irq, ks_pcie_err_irq_handler, IRQF_SHARED,
12591257
"ks-pcie-error-irq", ks_pcie);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,8 @@ static int meson_add_pcie_port(struct meson_pcie *mp,
488488

489489
if (IS_ENABLED(CONFIG_PCI_MSI)) {
490490
pp->msi_irq = platform_get_irq(pdev, 0);
491-
if (pp->msi_irq < 0) {
492-
dev_err(dev, "failed to get MSI IRQ\n");
491+
if (pp->msi_irq < 0)
493492
return pp->msi_irq;
494-
}
495493
}
496494

497495
pp->ops = &meson_pcie_host_ops;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,8 @@ static int armada8k_add_pcie_port(struct armada8k_pcie *pcie,
248248
pp->ops = &armada8k_pcie_host_ops;
249249

250250
pp->irq = platform_get_irq(pdev, 0);
251-
if (pp->irq < 0) {
252-
dev_err(dev, "failed to get irq for port\n");
251+
if (pp->irq < 0)
253252
return pp->irq;
254-
}
255253

256254
ret = devm_request_irq(dev, pp->irq, armada8k_pcie_irq_handler,
257255
IRQF_SHARED, "armada8k-pcie", pcie);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,8 @@ static int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie,
387387

388388
if (IS_ENABLED(CONFIG_PCI_MSI)) {
389389
pp->msi_irq = platform_get_irq_byname(pdev, "msi");
390-
if (pp->msi_irq < 0) {
391-
dev_err(dev, "failed to get MSI irq\n");
390+
if (pp->msi_irq < 0)
392391
return pp->msi_irq;
393-
}
394392
}
395393

396394
pp->ops = &artpec6_pcie_host_ops;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,8 @@ static int histb_pcie_probe(struct platform_device *pdev)
402402

403403
if (IS_ENABLED(CONFIG_PCI_MSI)) {
404404
pp->msi_irq = platform_get_irq_byname(pdev, "msi");
405-
if (pp->msi_irq < 0) {
406-
dev_err(dev, "Failed to get MSI IRQ\n");
405+
if (pp->msi_irq < 0)
407406
return pp->msi_irq;
408-
}
409407
}
410408

411409
hipcie->phy = devm_phy_get(dev, "phy");

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,8 @@ static int kirin_pcie_add_msi(struct dw_pcie *pci,
455455

456456
if (IS_ENABLED(CONFIG_PCI_MSI)) {
457457
irq = platform_get_irq(pdev, 0);
458-
if (irq < 0) {
459-
dev_err(&pdev->dev,
460-
"failed to get MSI IRQ (%d)\n", irq);
458+
if (irq < 0)
461459
return irq;
462-
}
463460

464461
pci->pp.msi_irq = irq;
465462
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,9 @@ static int spear13xx_add_pcie_port(struct spear13xx_pcie *spear13xx_pcie,
198198
int ret;
199199

200200
pp->irq = platform_get_irq(pdev, 0);
201-
if (pp->irq < 0) {
202-
dev_err(dev, "failed to get irq\n");
201+
if (pp->irq < 0)
203202
return pp->irq;
204-
}
203+
205204
ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler,
206205
IRQF_SHARED | IRQF_NO_THREAD,
207206
"spear1340-pcie", spear13xx_pcie);

0 commit comments

Comments
 (0)