* [PATCH] thermal: qcom-spmi-adc-tm5: drop IIO_VAL_INT check in adc_tm5_get_temp
@ 2026-07-24 11:00 Rakesh Kota
2026-07-25 21:40 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Rakesh Kota @ 2026-07-24 11:00 UTC (permalink / raw)
To: Amit Kucheria, Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano,
Zhang Rui, Lukasz Luba, Svyatoslav Ryhel, Hans de Goede,
Jonathan Cameron
Cc: linux-pm, linux-arm-msm, linux-kernel, Kamal Wadhwa,
Jishnu Prakash, Rakesh Kota
Commit bb21ee31f575 ("iio: Fix iio_multiply_value use in
iio_read_channel_processed_scale") fixed the
iio_read_channel_processed_scale to return 0 on success instead
of IIO_VAL_INT (1). The existing check in adc_tm5_get_temp()
treated a successful return as an error because it expected
IIO_VAL_INT. Drop the redundant `ret != IIO_VAL_INT` condition
and rely solely on the negative error check.
Fixes: bb21ee31f575 ("iio: Fix iio_multiply_value use in iio_read_channel_processed_scale")
Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
---
drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
index bb6222c8cc5f..af72db6299cd 100644
--- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
+++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
@@ -369,9 +369,6 @@ static int adc_tm5_get_temp(struct thermal_zone_device *tz, int *temp)
if (ret < 0)
return ret;
- if (ret != IIO_VAL_INT)
- return -EINVAL;
-
return 0;
}
---
base-commit: 9eebf259d5352b87080d67758f483583d9e763d7
change-id: 20260724-adc-tm5-drop-iio-val-int-check-38e27c4018c7
Best regards,
--
Rakesh Kota <rakesh.kota@oss.qualcomm.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: qcom-spmi-adc-tm5: drop IIO_VAL_INT check in adc_tm5_get_temp
2026-07-24 11:00 [PATCH] thermal: qcom-spmi-adc-tm5: drop IIO_VAL_INT check in adc_tm5_get_temp Rakesh Kota
@ 2026-07-25 21:40 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2026-07-25 21:40 UTC (permalink / raw)
To: Rakesh Kota
Cc: Amit Kucheria, Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano,
Zhang Rui, Lukasz Luba, Svyatoslav Ryhel, Hans de Goede, linux-pm,
linux-arm-msm, linux-kernel, Kamal Wadhwa, Jishnu Prakash,
linux-iio
On Fri, 24 Jul 2026 16:30:24 +0530
Rakesh Kota <rakesh.kota@oss.qualcomm.com> wrote:
> Commit bb21ee31f575 ("iio: Fix iio_multiply_value use in
> iio_read_channel_processed_scale") fixed the
> iio_read_channel_processed_scale to return 0 on success instead
> of IIO_VAL_INT (1). The existing check in adc_tm5_get_temp()
> treated a successful return as an error because it expected
> IIO_VAL_INT. Drop the redundant `ret != IIO_VAL_INT` condition
> and rely solely on the negative error check.
>
> Fixes: bb21ee31f575 ("iio: Fix iio_multiply_value use in iio_read_channel_processed_scale")
> Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
Ah. Sorry we missed that!
Change is fine but you might as well just
return iio_read_channel_processed() as it only returns 0 or negative error.
Either way
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
+CC linux-iio for info.
> ---
> drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> index bb6222c8cc5f..af72db6299cd 100644
> --- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> +++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> @@ -369,9 +369,6 @@ static int adc_tm5_get_temp(struct thermal_zone_device *tz, int *temp)
> if (ret < 0)
> return ret;
>
> - if (ret != IIO_VAL_INT)
> - return -EINVAL;
> -
> return 0;
> }
>
>
> ---
> base-commit: 9eebf259d5352b87080d67758f483583d9e763d7
> change-id: 20260724-adc-tm5-drop-iio-val-int-check-38e27c4018c7
>
> Best regards,
> --
> Rakesh Kota <rakesh.kota@oss.qualcomm.com>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-25 21:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 11:00 [PATCH] thermal: qcom-spmi-adc-tm5: drop IIO_VAL_INT check in adc_tm5_get_temp Rakesh Kota
2026-07-25 21:40 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox