Skip to content

Commit 802d9bd

Browse files
bebarinoLee Jones
authored andcommitted
mfd: Remove dev_err() usage after platform_get_irq()
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent b620c17 commit 802d9bd

6 files changed

Lines changed: 9 additions & 27 deletions

File tree

‎drivers/mfd/ab8500-debugfs.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,16 +2680,12 @@ static int ab8500_debug_probe(struct platform_device *plf)
26802680
irq_ab8500 = res->start;
26812681

26822682
irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");
2683-
if (irq_first < 0) {
2684-
dev_err(&plf->dev, "First irq not found, err %d\n", irq_first);
2683+
if (irq_first < 0)
26852684
return irq_first;
2686-
}
26872685

26882686
irq_last = platform_get_irq_byname(plf, "IRQ_LAST");
2689-
if (irq_last < 0) {
2690-
dev_err(&plf->dev, "Last irq not found, err %d\n", irq_last);
2687+
if (irq_last < 0)
26912688
return irq_last;
2692-
}
26932689

26942690
ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);
26952691

‎drivers/mfd/db8500-prcmu.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3130,10 +3130,8 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
31303130
writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);
31313131

31323132
irq = platform_get_irq(pdev, 0);
3133-
if (irq <= 0) {
3134-
dev_err(&pdev->dev, "no prcmu irq provided\n");
3133+
if (irq <= 0)
31353134
return irq;
3136-
}
31373135

31383136
err = request_threaded_irq(irq, prcmu_irq_handler,
31393137
prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);

‎drivers/mfd/fsl-imx25-tsadc.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev,
6969
int irq;
7070

7171
irq = platform_get_irq(pdev, 0);
72-
if (irq <= 0) {
73-
dev_err(dev, "Failed to get irq\n");
72+
if (irq <= 0)
7473
return irq;
75-
}
7674

7775
tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,
7876
tsadc);

‎drivers/mfd/intel_soc_pmic_bxtwc.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,8 @@ static int bxtwc_probe(struct platform_device *pdev)
450450
return -ENOMEM;
451451

452452
ret = platform_get_irq(pdev, 0);
453-
if (ret < 0) {
454-
dev_err(&pdev->dev, "Invalid IRQ\n");
453+
if (ret < 0)
455454
return ret;
456-
}
457455
pmic->irq = ret;
458456

459457
dev_set_drvdata(&pdev->dev, pmic);

‎drivers/mfd/qcom_rpm.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -561,22 +561,16 @@ static int qcom_rpm_probe(struct platform_device *pdev)
561561
clk_prepare_enable(rpm->ramclk); /* Accepts NULL */
562562

563563
irq_ack = platform_get_irq_byname(pdev, "ack");
564-
if (irq_ack < 0) {
565-
dev_err(&pdev->dev, "required ack interrupt missing\n");
564+
if (irq_ack < 0)
566565
return irq_ack;
567-
}
568566

569567
irq_err = platform_get_irq_byname(pdev, "err");
570-
if (irq_err < 0) {
571-
dev_err(&pdev->dev, "required err interrupt missing\n");
568+
if (irq_err < 0)
572569
return irq_err;
573-
}
574570

575571
irq_wakeup = platform_get_irq_byname(pdev, "wakeup");
576-
if (irq_wakeup < 0) {
577-
dev_err(&pdev->dev, "required wakeup interrupt missing\n");
572+
if (irq_wakeup < 0)
578573
return irq_wakeup;
579-
}
580574

581575
match = of_match_device(qcom_rpm_of_match, &pdev->dev);
582576
if (!match)

‎drivers/mfd/sm501.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,10 +1394,8 @@ static int sm501_plat_probe(struct platform_device *dev)
13941394
sm->platdata = dev_get_platdata(&dev->dev);
13951395

13961396
ret = platform_get_irq(dev, 0);
1397-
if (ret < 0) {
1398-
dev_err(&dev->dev, "failed to get irq resource\n");
1397+
if (ret < 0)
13991398
goto err_res;
1400-
}
14011399
sm->irq = ret;
14021400

14031401
sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);

0 commit comments

Comments
 (0)