History

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).

Stephen Boyd committed 7 years ago

Commit 802d9bd1 parent b620c176 files · +9 −27Browse files

Unified · Split

6 files
  1. drivers/mfd/ab8500-debugfs.c +2 −6
  2. drivers/mfd/db8500-prcmu.c +1 −3
  3. drivers/mfd/fsl-imx25-tsadc.c +1 −3
  4. drivers/mfd/intel_soc_pmic_bxtwc.c +1 −3
  5. drivers/mfd/qcom_rpm.c +3 −9
  6. drivers/mfd/sm501.c +1 −3
drivers/mfd/ab8500-debugfs.c+2−6
@@ -2680,16 +2680,12 @@ static int ab8500_debug_probe(struct platform_device *plf) · 2679 unmodified lines
2680 irq_ab8500 = res->start;2680 irq_ab8500 = res->start;
2681 2681
2682 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");2682 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");
2683 if (irq_first < 0) {2683 if (irq_first < 0)
2684 dev_err(&plf->dev, "First irq not found, err %d\n", irq_first);
2685 return irq_first;2684 return irq_first;
2686 }
2687 2685
2688 irq_last = platform_get_irq_byname(plf, "IRQ_LAST");2686 irq_last = platform_get_irq_byname(plf, "IRQ_LAST");
2689 if (irq_last < 0) {2687 if (irq_last < 0)
2690 dev_err(&plf->dev, "Last irq not found, err %d\n", irq_last);
2691 return irq_last;2688 return irq_last;
2692 }
2693 2689
2694 ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);2690 ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);
2695 2691
drivers/mfd/db8500-prcmu.c+1−3
@@ -3130,10 +3130,8 @@ static int db8500_prcmu_probe(struct platform_device *pdev) · 3129 unmodified lines
3130 writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);3130 writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);
3131 3131
3132 irq = platform_get_irq(pdev, 0);3132 irq = platform_get_irq(pdev, 0);
3133 if (irq <= 0) {3133 if (irq <= 0)
3134 dev_err(&pdev->dev, "no prcmu irq provided\n");
3135 return irq;3134 return irq;
3136 }
3137 3135
3138 err = request_threaded_irq(irq, prcmu_irq_handler,3136 err = request_threaded_irq(irq, prcmu_irq_handler,
3139 prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);3137 prcmu_irq_thread_fn, IRQF_NO_SUSPEND, "prcmu", NULL);
drivers/mfd/fsl-imx25-tsadc.c+1−3
@@ -69,10 +69,8 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev, · 68 unmodified lines
69 int irq;69 int irq;
70 70
71 irq = platform_get_irq(pdev, 0);71 irq = platform_get_irq(pdev, 0);
72 if (irq <= 0) {72 if (irq <= 0)
73 dev_err(dev, "Failed to get irq\n");
74 return irq;73 return irq;
75 }
76 74
77 tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,75 tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,
78 tsadc);76 tsadc);
drivers/mfd/intel_soc_pmic_bxtwc.c+1−3
@@ -450,10 +450,8 @@ static int bxtwc_probe(struct platform_device *pdev) · 449 unmodified lines
450 return -ENOMEM;450 return -ENOMEM;
451 451
452 ret = platform_get_irq(pdev, 0);452 ret = platform_get_irq(pdev, 0);
453 if (ret < 0) {453 if (ret < 0)
454 dev_err(&pdev->dev, "Invalid IRQ\n");
455 return ret;454 return ret;
456 }
457 pmic->irq = ret;455 pmic->irq = ret;
458 456
459 dev_set_drvdata(&pdev->dev, pmic);457 dev_set_drvdata(&pdev->dev, pmic);
drivers/mfd/qcom_rpm.c+3−9
@@ -561,22 +561,16 @@ static int qcom_rpm_probe(struct platform_device *pdev) · 560 unmodified lines
561 clk_prepare_enable(rpm->ramclk); /* Accepts NULL */561 clk_prepare_enable(rpm->ramclk); /* Accepts NULL */
562 562
563 irq_ack = platform_get_irq_byname(pdev, "ack");563 irq_ack = platform_get_irq_byname(pdev, "ack");
564 if (irq_ack < 0) {564 if (irq_ack < 0)
565 dev_err(&pdev->dev, "required ack interrupt missing\n");
566 return irq_ack;565 return irq_ack;
567 }
568 566
569 irq_err = platform_get_irq_byname(pdev, "err");567 irq_err = platform_get_irq_byname(pdev, "err");
570 if (irq_err < 0) {568 if (irq_err < 0)
571 dev_err(&pdev->dev, "required err interrupt missing\n");
572 return irq_err;569 return irq_err;
573 }
574 570
575 irq_wakeup = platform_get_irq_byname(pdev, "wakeup");571 irq_wakeup = platform_get_irq_byname(pdev, "wakeup");
576 if (irq_wakeup < 0) {572 if (irq_wakeup < 0)
577 dev_err(&pdev->dev, "required wakeup interrupt missing\n");
578 return irq_wakeup;573 return irq_wakeup;
579 }
580 574
581 match = of_match_device(qcom_rpm_of_match, &pdev->dev);575 match = of_match_device(qcom_rpm_of_match, &pdev->dev);
582 if (!match)576 if (!match)
drivers/mfd/sm501.c+1−3
@@ -1394,10 +1394,8 @@ static int sm501_plat_probe(struct platform_device *dev) · 1393 unmodified lines
1394 sm->platdata = dev_get_platdata(&dev->dev);1394 sm->platdata = dev_get_platdata(&dev->dev);
1395 1395
1396 ret = platform_get_irq(dev, 0);1396 ret = platform_get_irq(dev, 0);
1397 if (ret < 0) {1397 if (ret < 0)
1398 dev_err(&dev->dev, "failed to get irq resource\n");
1399 goto err_res;1398 goto err_res;
1400 }
1401 sm->irq = ret;1399 sm->irq = ret;
1402 1400
1403 sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);1401 sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t