thermal-generic-adc: Silent error message for EPROBE_DEFER
authorHsin-Yi Wang <hsinyi@chromium.org>
Tue, 10 Sep 2019 07:59:07 +0000 (15:59 +0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 7 Nov 2019 06:00:26 +0000 (07:00 +0100)
If devm_iio_channel_get() or devm_thermal_zone_of_sensor_register()
fail with EPROBE_DEFER, we shouldn't print an error message, as the
device will be probed again later.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20190910075907.132200-1-hsinyi@chromium.org
drivers/thermal/thermal-generic-adc.c

index dcecf2e..ae5743c 100644 (file)
@@ -134,7 +134,8 @@ static int gadc_thermal_probe(struct platform_device *pdev)
        gti->channel = devm_iio_channel_get(&pdev->dev, "sensor-channel");
        if (IS_ERR(gti->channel)) {
                ret = PTR_ERR(gti->channel);
-               dev_err(&pdev->dev, "IIO channel not found: %d\n", ret);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(&pdev->dev, "IIO channel not found: %d\n", ret);
                return ret;
        }
 
@@ -142,8 +143,10 @@ static int gadc_thermal_probe(struct platform_device *pdev)
                                                           &gadc_thermal_ops);
        if (IS_ERR(gti->tz_dev)) {
                ret = PTR_ERR(gti->tz_dev);
-               dev_err(&pdev->dev, "Thermal zone sensor register failed: %d\n",
-                       ret);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(&pdev->dev,
+                               "Thermal zone sensor register failed: %d\n",
+                               ret);
                return ret;
        }