public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] hwmon: (ads7871) Fix concurrency and modernize API
@ 2026-03-28 18:20 Tabrez Ahmed
  2026-03-28 18:20 ` [PATCH 1/2] hwmon: (ads7871) Add mutex to serialize SPI transactions Tabrez Ahmed
  2026-03-28 18:20 ` [PATCH 2/2] hwmon: (ads7871) Convert to hwmon_device_register_with_info Tabrez Ahmed
  0 siblings, 2 replies; 5+ messages in thread
From: Tabrez Ahmed @ 2026-03-28 18:20 UTC (permalink / raw)
  To: linux; +Cc: linux-hwmon, linux-kernel, shuah, me, Tabrez Ahmed

This patch series addresses a concurrency issue in the ads7871 driver and 
modernizes it to use the current hwmon API.

Patch 1: Adds a mutex to the driver's private data to serialize SPI 
transactions. Previously, if userspace read multiple 
channels concurrently, the driver could overwrite ongoing REG_GAIN_MUX 
writes before the conversion completed.

Patch 2: Converts the driver to use hwmon_device_register_with_info(). 
This architectural shift removes boilerplate code and delegates sysfs 
management to the hwmon core:
 - Removes manual file creators (SENSOR_DEVICE_ATTR_RO and ads7871_attrs).
 - Implements ads7871_is_visible() for dynamic permission control.
 - Replaces the sysfs-specific voltage_show() with a 
standard ads7871_read() callback.
 - Defines supported channels via hwmon_channel_info.

Tabrez Ahmed (2):
  hwmon: (ads7871) Add mutex to serialize SPI transactions
  hwmon: (ads7871) Convert to hwmon_device_register_with_info

 drivers/hwmon/ads7871.c | 91 +++++++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 39 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-03-29  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 18:20 [PATCH 0/2] hwmon: (ads7871) Fix concurrency and modernize API Tabrez Ahmed
2026-03-28 18:20 ` [PATCH 1/2] hwmon: (ads7871) Add mutex to serialize SPI transactions Tabrez Ahmed
2026-03-29  3:16   ` Guenter Roeck
2026-03-29  5:00     ` Tabrez Ahmed
2026-03-28 18:20 ` [PATCH 2/2] hwmon: (ads7871) Convert to hwmon_device_register_with_info Tabrez Ahmed

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