Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephen Boyd and committed by
Lee Jones
802d9bd4 b620c176

+9 -27
+2 -6
drivers/mfd/ab8500-debugfs.c
··· 2680 2680 irq_ab8500 = res->start; 2681 2681 2682 2682 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) 2685 2684 return irq_first; 2686 - } 2687 2685 2688 2686 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) 2691 2688 return irq_last; 2692 - } 2693 2689 2694 2690 ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL); 2695 2691
+1 -3
drivers/mfd/db8500-prcmu.c
··· 3130 3130 writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR); 3131 3131 3132 3132 irq = platform_get_irq(pdev, 0); 3133 - if (irq <= 0) { 3134 - dev_err(&pdev->dev, "no prcmu irq provided\n"); 3133 + if (irq <= 0) 3135 3134 return irq; 3136 - } 3137 3135 3138 3136 err = request_threaded_irq(irq, prcmu_irq_handler, 3139 3137 prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
+1 -3
drivers/mfd/fsl-imx25-tsadc.c
··· 69 69 int irq; 70 70 71 71 irq = platform_get_irq(pdev, 0); 72 - if (irq <= 0) { 73 - dev_err(dev, "Failed to get irq\n"); 72 + if (irq <= 0) 74 73 return irq; 75 - } 76 74 77 75 tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops, 78 76 tsadc);
+1 -3
drivers/mfd/intel_soc_pmic_bxtwc.c
··· 450 450 return -ENOMEM; 451 451 452 452 ret = platform_get_irq(pdev, 0); 453 - if (ret < 0) { 454 - dev_err(&pdev->dev, "Invalid IRQ\n"); 453 + if (ret < 0) 455 454 return ret; 456 - } 457 455 pmic->irq = ret; 458 456 459 457 dev_set_drvdata(&pdev->dev, pmic);
+3 -9
drivers/mfd/qcom_rpm.c
··· 561 561 clk_prepare_enable(rpm->ramclk); /* Accepts NULL */ 562 562 563 563 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) 566 565 return irq_ack; 567 - } 568 566 569 567 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) 572 569 return irq_err; 573 - } 574 570 575 571 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) 578 573 return irq_wakeup; 579 - } 580 574 581 575 match = of_match_device(qcom_rpm_of_match, &pdev->dev); 582 576 if (!match)
+1 -3
drivers/mfd/sm501.c
··· 1394 1394 sm->platdata = dev_get_platdata(&dev->dev); 1395 1395 1396 1396 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) 1399 1398 goto err_res; 1400 - } 1401 1399 sm->irq = ret; 1402 1400 1403 1401 sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);