OSDN Git Service

thermal: Delete an error message in four functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 5 Apr 2020 16:35:16 +0000 (18:35 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 14 Apr 2020 09:41:12 +0000 (11:41 +0200)
The function “platform_get_irq” can log an error already.
Thus omit redundant messages for the exception handling in the
calling functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Reviewed-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/05f49ae7-5cc7-d6a0-fc3d-abaf2a0b373c@web.de
drivers/thermal/rockchip_thermal.c
drivers/thermal/st/st_thermal_memmap.c
drivers/thermal/st/stm_thermal.c
drivers/thermal/ti-soc-thermal/ti-bandgap.c

index 7c1a8bc..15a71ec 100644 (file)
@@ -1241,10 +1241,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
                return -ENXIO;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq resource?\n");
+       if (irq < 0)
                return -EINVAL;
-       }
 
        thermal = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_thermal_data),
                               GFP_KERNEL);
index a824b78..a011445 100644 (file)
@@ -94,10 +94,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
        int ret;
 
        sensor->irq = platform_get_irq(pdev, 0);
-       if (sensor->irq < 0) {
-               dev_err(dev, "failed to register IRQ\n");
+       if (sensor->irq < 0)
                return sensor->irq;
-       }
 
        ret = devm_request_threaded_irq(dev, sensor->irq,
                                        NULL, st_mmap_thermal_trip_handler,
index 9314e3d..331e2b7 100644 (file)
@@ -385,10 +385,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
        int ret;
 
        sensor->irq = platform_get_irq(pdev, 0);
-       if (sensor->irq < 0) {
-               dev_err(dev, "%s: Unable to find IRQ\n", __func__);
+       if (sensor->irq < 0)
                return sensor->irq;
-       }
 
        ret = devm_request_threaded_irq(dev, sensor->irq,
                                        NULL,
index 263b042..ab19cef 100644 (file)
@@ -772,10 +772,9 @@ static int ti_bandgap_talert_init(struct ti_bandgap *bgp,
        int ret;
 
        bgp->irq = platform_get_irq(pdev, 0);
-       if (bgp->irq < 0) {
-               dev_err(&pdev->dev, "get_irq failed\n");
+       if (bgp->irq < 0)
                return bgp->irq;
-       }
+
        ret = request_threaded_irq(bgp->irq, NULL,
                                   ti_bandgap_talert_irq_handler,
                                   IRQF_TRIGGER_HIGH | IRQF_ONESHOT,