The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/1] hwmon: (applesmc) Convert to hwmon_device_register_with_info
@ 2026-07-10 12:32 Shih-Yuan Lee
  2026-07-10 12:32 ` [PATCH 1/1] " Shih-Yuan Lee
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Shih-Yuan Lee @ 2026-07-10 12:32 UTC (permalink / raw)
  To: Henrik Rydberg, Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Shih-Yuan Lee

Hi Henrik and Guenter,

This patch converts the applesmc driver from using the deprecated
hwmon_device_register() function to the modern hwmon_device_register_with_info()
API. This silences the following deprecation warning from dmesg on load:

[   24.706091] applesmc: key=620 fan=0 temp=37 index=36 acc=0 lux=2 kbd=0
[   24.706270] applesmc applesmc.768: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().

Because the driver creates all its sysfs attributes dynamically on the platform
device, we define a minimal struct hwmon_chip_info with a single temperature
channel and implement a visibility callback that returns 0 (hidden) for it.

This satisfies the new API requirements while keeping all existing sysfs paths
and attributes completely unchanged under the platform device directory
(/sys/devices/platform/applesmc.768/), ensuring 100% backwards compatibility
with existing user-space fan control tools (such as mbpfan and macfanctld).

Shih-Yuan Lee (1):
  hwmon: (applesmc) Convert to hwmon_device_register_with_info

 drivers/hwmon/applesmc.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

-- 
2.39.5


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

end of thread, other threads:[~2026-07-11  9:33 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 12:32 [PATCH 0/1] hwmon: (applesmc) Convert to hwmon_device_register_with_info Shih-Yuan Lee
2026-07-10 12:32 ` [PATCH 1/1] " Shih-Yuan Lee
2026-07-10 14:01   ` Guenter Roeck
2026-07-10 21:10     ` Armin Wolf
2026-07-10 22:28       ` Guenter Roeck
2026-07-11  2:51         ` Shih-Yuan Lee (FourDollars)
2026-07-11  3:36 ` [PATCH v2 0/1] " Shih-Yuan Lee
2026-07-11  3:37   ` [PATCH v2 1/1] " Shih-Yuan Lee
2026-07-11  5:39 ` [PATCH v3 0/1] " Shih-Yuan Lee
2026-07-11  5:39   ` [PATCH v3 1/1] " Shih-Yuan Lee
2026-07-11  6:06 ` [PATCH v4 0/1] " Shih-Yuan Lee
2026-07-11  6:06   ` [PATCH v4 1/1] " Shih-Yuan Lee
2026-07-11  7:57 ` [PATCH v5 0/3] " Shih-Yuan Lee
2026-07-11  7:57   ` [PATCH v5 1/3] hwmon: (applesmc) Cache fan positions during register initialization Shih-Yuan Lee
2026-07-11  7:57   ` [PATCH v5 2/3] hwmon: (applesmc) Fix lockless cache validation data race Shih-Yuan Lee
2026-07-11  7:57   ` [PATCH v5 3/3] hwmon: (applesmc) Convert to hwmon_device_register_with_info Shih-Yuan Lee
2026-07-11  9:33 ` [PATCH v6 0/3] " Shih-Yuan Lee
2026-07-11  9:33   ` [PATCH v6 1/3] hwmon: (applesmc) Cache fan positions during register initialization Shih-Yuan Lee
2026-07-11  9:33   ` [PATCH v6 2/3] hwmon: (applesmc) Fix lockless cache validation data race Shih-Yuan Lee
2026-07-11  9:33   ` [PATCH v6 3/3] hwmon: (applesmc) Convert to hwmon_device_register_with_info Shih-Yuan Lee

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