hwmon: (sysfs) Allow drivers to register const attributes

Switch to the __DEVICE_ATTR() macro which can handle callbacks taking
both const and non-const attribute structure arguments.
Allow the step-wise migration of the drivers.

Also use container_of_const() over container_of() to avoid casting away
the constness accidentally.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20260806-sysfs-const-attr-hwmon-v2-3-22fee8b85509@weissschuh.net
[groeck: Squashed 'hwmon: (core) Constify PEC device attribute']
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Thomas Weißschuh 2026-08-06 08:09:13 +02:00 • committed by Guenter Roeck
commit 87fdc8d7bb
2 changed files with 10 additions and 10 deletions