diff mbox series

thermal-generic-adc: Silent error message for EPROBE_DEFER

Message ID 20190910075907.132200-1-hsinyi@chromium.org (mailing list archive)
State Accepted, archived
Delegated to: Zhang Rui
Headers show
Series thermal-generic-adc: Silent error message for EPROBE_DEFER | expand

Commit Message

Hsin-Yi Wang Sept. 10, 2019, 7:59 a.m. UTC
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>
---
 drivers/thermal/thermal-generic-adc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Hsin-Yi Wang Oct. 7, 2019, 5:07 p.m. UTC | #1
On Tue, Sep 10, 2019 at 12:59 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> 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>
> ---

Ping on the thread. Any suggestion for this patch?
Thanks
Jonathan Cameron Oct. 8, 2019, 11:45 a.m. UTC | #2
On Mon, 7 Oct 2019 10:07:22 -0700
Hsin-Yi Wang <hsinyi@chromium.org> wrote:

> On Tue, Sep 10, 2019 at 12:59 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > 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>
> > ---  
> 
> Ping on the thread. Any suggestion for this patch?
> Thanks

Looks sensible to me.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Daniel Lezcano Oct. 8, 2019, 1:57 p.m. UTC | #3
On 08/10/2019 13:45, Jonathan Cameron wrote:
> On Mon, 7 Oct 2019 10:07:22 -0700
> Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> 
>> On Tue, Sep 10, 2019 at 12:59 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>>
>>> 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>
>>> ---  
>>
>> Ping on the thread. Any suggestion for this patch?
>> Thanks
> 
> Looks sensible to me.
> 
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I've applied this patch on the testing branch.

Thanks!
diff mbox series

Patch

diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
index dcecf2e8dc8e..ae5743c9a894 100644
--- a/drivers/thermal/thermal-generic-adc.c
+++ b/drivers/thermal/thermal-generic-adc.c
@@ -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;
 	}