]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ti-ads7950: do not clobber gpio state in ti_ads7950_get()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 5 Mar 2026 19:21:53 +0000 (11:21 -0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 7 Mar 2026 11:40:37 +0000 (11:40 +0000)
commitd20bbae6e5d408a8a7c2a4344d76dd1ac557a149
tree24c5a1040d8592227dcaf189756b8eab3a636a5f
parente2fa075d5ce1963e7cb7b0ac708ba567e5af66db
iio: adc: ti-ads7950: do not clobber gpio state in ti_ads7950_get()

GPIO state was inadvertently overwritten by the result of spi_sync(),
resulting in ti_ads7950_get() only returning 0 as GPIO state (or error).

Fix this by introducing a separate variable to hold the state.

Fixes: c97dce792dc8 ("iio: adc: ti-ads7950: add GPIO support")
Reported-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads7950.c