public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tabrez Ahmed <tabreztalks@gmail.com>
To: linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	shuah@kernel.org, me@brighamcampbell.com,
	Tabrez Ahmed <tabreztalks@gmail.com>
Subject: [PATCH 0/2] hwmon: (ads7871) Fix concurrency and modernize API
Date: Sat, 28 Mar 2026 23:50:13 +0530	[thread overview]
Message-ID: <20260328182015.220298-1-tabreztalks@gmail.com> (raw)

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


             reply	other threads:[~2026-03-28 18:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-28 18:20 Tabrez Ahmed [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260328182015.220298-1-tabreztalks@gmail.com \
    --to=tabreztalks@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=me@brighamcampbell.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox