[PATCH v2 0/1] hwmon: (applesmc) Convert to hwmon_device_register_with_info
From: Shih-Yuan Lee
Date: Fri Jul 10 2026 - 23:37:42 EST
Hi Guenter, Armin, and Henrik,
This is v2 of the patch series converting the applesmc driver from using
the deprecated hwmon_device_register() function to the modern
hwmon_device_register_with_info() API.
Changes in v2:
- Abandon the minimal dummy registration approach in v1.
- Fully convert the driver to modern HWMON ABI standards by dynamically
allocating temp and fan channels at initialization.
- Rename legacy non-standard attributes to comply with the standard HWMON ABI:
- fanX_output -> fanX_target (HWMON_F_TARGET)
- fanX_manual -> pwmX_enable (HWMON_PWM_ENABLE)
- Dynamically register the remaining non-standard fanX_safe attributes
under HWMON class directory via extra_groups.
- Load and cache fan positions in smcreg.fan_positions to support returning
labels by reference in .read_string.
- Clean up unused static attribute groups and show/store callback functions
to avoid unused symbol compiler warnings.
- Verified compilation and successfully tested on real MacBook hardware.
We appreciate your review and comments on this proper refactoring.
Shih-Yuan Lee (1):
hwmon: (applesmc) Convert to hwmon_device_register_with_info
drivers/hwmon/applesmc.c | 458 ++++++++++++++++++++++++++-------------
1 file changed, 309 insertions(+), 149 deletions(-)
--
2.39.5