public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] ti-ads7950: fix gpio handling and facelift
@ 2026-03-29 22:47 Dmitry Torokhov
  2026-03-29 22:47 ` [PATCH v4 1/4] iio: adc: ti-ads7950: switch to using guard() notation Dmitry Torokhov
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Dmitry Torokhov @ 2026-03-29 22:47 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner
  Cc: Nuno Sá, Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	linux-iio, linux-kernel, linux-gpio, Jonathan Cameron

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.

---
Changes in v4:
- rebased on top of latest next
- dropped the 2 already applied patches
- restored inadvertently removed mutex_init() (Andy)
- stopped calling devm_regulator_get_enable_read_voltage() on ACPI
  systems as it is guaranteed to fail (David, Jonathan)
- removed call to spi_set_drvdata() since it is not needed anymore (David)
- Link to v3: https://patch.msgid.link/20260305-ti-ads7950-facelift-v3-0-a23fdd1a079e@gmail.com

Changes in 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)

Changes in v2:

- style fixes in #1 (per David)
- fix to not clobber state (#2, new)
- #3 and #4 (new)

---
Dmitry Torokhov (4):
      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 | 195 ++++++++++++++-----------------------------
 1 file changed, 62 insertions(+), 133 deletions(-)
---
base-commit: 3b058d1aeeeff27a7289529c4944291613b364e9
change-id: 20260220-ti-ads7950-facelift-ad8b5390a654

Thanks.

-- 
Dmitry


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-04-12 18:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-29 22:47 [PATCH v4 0/4] ti-ads7950: fix gpio handling and facelift Dmitry Torokhov
2026-03-29 22:47 ` [PATCH v4 1/4] iio: adc: ti-ads7950: switch to using guard() notation Dmitry Torokhov
2026-03-30  9:15   ` Bartosz Golaszewski
2026-03-30  9:18     ` Dmitry Torokhov
2026-03-30  9:21       ` Bartosz Golaszewski
2026-04-12 18:36         ` Jonathan Cameron
2026-03-29 22:47 ` [PATCH v4 2/4] iio: adc: ti-ads7950: simplify check for spi_setup() failures Dmitry Torokhov
2026-03-30  9:15   ` Bartosz Golaszewski
2026-03-29 22:47 ` [PATCH v4 3/4] iio: adc: ti-ads7950: switch to using devm_regulator_get_enable_read_voltage() Dmitry Torokhov
2026-03-30  9:17   ` Bartosz Golaszewski
2026-03-29 22:47 ` [PATCH v4 4/4] iio: adc: ti-ads7950: complete conversion to using managed resources Dmitry Torokhov
2026-03-30  9:20   ` Bartosz Golaszewski
2026-03-30  9:24     ` Dmitry Torokhov
2026-03-30 10:15       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox