[PATCH 03/12] iio: adc: Remove redundant error log prints

Xichao Zhao posted 12 patches 5 months, 1 week ago
[PATCH 03/12] iio: adc: Remove redundant error log prints
Posted by Xichao Zhao 5 months, 1 week ago
devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/iio/adc/sun4i-gpadc-iio.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 6b8d6bee1873..3b33480813fe 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -640,12 +640,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
 		 * Do not fail driver probing when failing to register in
 		 * thermal because no thermal DT node is found.
 		 */
-		if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) {
-			dev_err(&pdev->dev,
-				"could not register thermal sensor: %ld\n",
-				PTR_ERR(info->tzd));
+		if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV)
 			return PTR_ERR(info->tzd);
-		}
 	}
 
 	ret = devm_iio_device_register(&pdev->dev, indio_dev);
-- 
2.34.1
Re: [PATCH 03/12] iio: adc: Remove redundant error log prints
Posted by Chen-Yu Tsai 5 months, 1 week ago
On Fri, Sep 5, 2025 at 3:26 PM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> devm_thermal_of_zone_register() prints error log messages when
> it fails, so there is no need to print error log messages again.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  drivers/iio/adc/sun4i-gpadc-iio.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> index 6b8d6bee1873..3b33480813fe 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -640,12 +640,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
>                  * Do not fail driver probing when failing to register in
>                  * thermal because no thermal DT node is found.
>                  */
> -               if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) {
> -                       dev_err(&pdev->dev,
> -                               "could not register thermal sensor: %ld\n",
> -                               PTR_ERR(info->tzd));
> +               if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV)

I think the comment above is pretty clear that we don't want a failure
or an error message when it is failing just because the DT is missing
thermal zones.

ChenYu

>                         return PTR_ERR(info->tzd);
> -               }
>         }
>
>         ret = devm_iio_device_register(&pdev->dev, indio_dev);
> --
> 2.34.1
>