Re: [PATCH v3 0/6] ti-ads7950: fix gpio handling and facelift

From: Jonathan Cameron

Date: Sat Mar 07 2026 - 06:43:43 EST


On Thu, 05 Mar 2026 11:21:51 -0800
Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:

> The original reason for this series is to make sure ti_ads7950_get()
> returns result in range [0, 1] or a negative error code to comply with
> gpiolib requirement.
>
> During review David noticed the fact that the function also clobbers
> gpio state. Fixing that lead to adding cleanups using guard() and devm.
>
Applied patches 1 and 2 to the fixes-togreg branch of iio.git and marked
them for stable.

The rest will need to wait for those to be upstream. Given I have the
memory of a goldfish and there will it seems be a v4, please mention
that in the cover letter.

Thanks,

Jonathan

> v3:
>
> - Added "Fixes" tags
> - Picked up reviewed-by tags for #1 and #2
> - Dropped the conversion to "error" variables
> - Avoid using scoped_guard (per David)
> - directly return results of function calls at the end of function (David)
> - Split spi_sync() error handling into a new patxch (Andy)
> - Switch to using devm_regulator_get_enable_read_voltage() (David)
>
> v2:
>
> - style fixes in #1 (per David)
> - fix to not clobber state (#2, new)
> - #3 and #4 (new)
>
> ---
> Dmitry Torokhov (6):
> iio: adc: ti-ads7950: normalize return value of gpio_get
> iio: adc: ti-ads7950: do not clobber gpio state in ti_ads7950_get()
> iio: adc: ti-ads7950: switch to using guard() notation
> iio: adc: ti-ads7950: simplify check for spi_setup() failures
> iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage()
> iio: adc: ti-ads7950: complete conversion to using managed resources
>
> drivers/iio/adc/ti-ads7950.c | 188 ++++++++++++++-----------------------------
> 1 file changed, 59 insertions(+), 129 deletions(-)
> ---
> base-commit: c025f6cf4209e1542ec2afebe49f42bbaf1a5c7b
> change-id: 20260220-ti-ads7950-facelift-ad8b5390a654
>
> Thanks.
>