iio: adc: Remove redundant dev_err_probe()
authorRuan Jinjie <ruanjinjie@huawei.com>
Thu, 27 Jul 2023 07:39:12 +0000 (15:39 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 29 Jul 2023 11:13:17 +0000 (12:13 +0100)
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.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20230727073912.4178659-1-ruanjinjie@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ab8500-gpadc.c
drivers/iio/adc/imx7d_adc.c
drivers/iio/adc/palmas_gpadc.c
drivers/iio/adc/rockchip_saradc.c
drivers/iio/light/cm3605.c

index 4fa2126..3b1bdd0 100644 (file)
@@ -1099,14 +1099,12 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 
        gpadc->irq_sw = platform_get_irq_byname(pdev, "SW_CONV_END");
        if (gpadc->irq_sw < 0)
-               return dev_err_probe(dev, gpadc->irq_sw,
-                                    "failed to get platform sw_conv_end irq\n");
+               return gpadc->irq_sw;
 
        if (is_ab8500(gpadc->ab8500)) {
                gpadc->irq_hw = platform_get_irq_byname(pdev, "HW_CONV_END");
                if (gpadc->irq_hw < 0)
-                       return dev_err_probe(dev, gpadc->irq_hw,
-                                            "failed to get platform hw_conv_end irq\n");
+                       return gpadc->irq_hw;
        } else {
                gpadc->irq_hw = 0;
        }
index 22da81b..828d3fe 100644 (file)
@@ -496,7 +496,7 @@ static int imx7d_adc_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
-               return dev_err_probe(dev, irq, "Failed getting irq\n");
+               return irq;
 
        info->clk = devm_clk_get(dev, "adc");
        if (IS_ERR(info->clk))
index 3d7cfbb..e202ea1 100644 (file)
@@ -915,8 +915,7 @@ static int palmas_gpadc_probe(struct platform_device *pdev)
 
        adc->irq_auto_0 = platform_get_irq(pdev, 1);
        if (adc->irq_auto_0 < 0)
-               return dev_err_probe(adc->dev, adc->irq_auto_0,
-                                    "get auto0 irq failed\n");
+               return adc->irq_auto_0;
 
        ret = devm_request_threaded_irq(&pdev->dev, adc->irq_auto_0, NULL,
                                        palmas_gpadc_irq_auto, IRQF_ONESHOT,
@@ -928,8 +927,7 @@ static int palmas_gpadc_probe(struct platform_device *pdev)
 
        adc->irq_auto_1 = platform_get_irq(pdev, 2);
        if (adc->irq_auto_1 < 0)
-               return dev_err_probe(adc->dev, adc->irq_auto_1,
-                                    "get auto1 irq failed\n");
+               return adc->irq_auto_1;
 
        ret = devm_request_threaded_irq(&pdev->dev, adc->irq_auto_1, NULL,
                                        palmas_gpadc_irq_auto, IRQF_ONESHOT,
index 19ce431..dd94667 100644 (file)
@@ -466,7 +466,7 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
-               return dev_err_probe(&pdev->dev, irq, "failed to get irq\n");
+               return irq;
 
        ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr,
                               0, dev_name(&pdev->dev), info);
index 0b30db7..e7f0b81 100644 (file)
@@ -227,7 +227,7 @@ static int cm3605_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               ret = dev_err_probe(dev, irq, "failed to get irq\n");
+               ret = irq;
                goto out_disable_aset;
        }