summaryrefslogtreecommitdiff
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorHuisong Li <lihuisong@huawei.com>2025-03-19 05:06:38 +0300
committerGuenter Roeck <linux@roeck-us.net>2025-03-21 18:01:05 +0300
commit16746ce8adfe04f9ff8df75c1133286ba93c0e17 (patch)
tree02dd871d39e687d9cbf96c4d479f3d7fd209aa9e /lib/debugobjects.c
parentbf1bb26f23f10f835e596337604d32d34ab798a6 (diff)
downloadlinux-16746ce8adfe04f9ff8df75c1133286ba93c0e17.tar.xz
hwmon: (acpi_power_meter) Replace the deprecated hwmon_device_register
When load this mode, we can see the following log: "power_meter ACPI000D:00: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info()." So replace hwmon_device_register with hwmon_device_register_with_info. These attributes, 'power_accuracy', 'power_cap_hyst', 'power_average_min' and 'power_average_max', should have been placed in hwmon_chip_info as power data type. But these attributes are displayed as string format on the following case: a) power1_accuracy --> display like '90.0%' b) power1_cap_hyst --> display 'unknown' when its value is 0xFFFFFFFF c) power1_average_min/max --> display 'unknown' when its value is negative. To avoid any changes in the display of these sysfs interfaces, we can't modifiy the type of these attributes in hwmon core and have to put them to extra_groups. Please note that the path of these sysfs interfaces are modified accordingly if use hwmon_device_register_with_info(): old: all sysfs interfaces are under acpi device, namely, /sys/class/hwmon/hwmonX/device/ now: all sysfs interfaces are under hwmon device, namely, /sys/class/hwmon/hwmonX/ The new ABI does not guarantee that the underlying path remains the same. But we have to accept this change so as to replace the deprecated API. Fortunately, some userspace application, like libsensors, would scan the two path and handles this automatically. So we can accept this change so as to drop the deprecated message. Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://lore.kernel.org/r/20250319020638.59925-1-lihuisong@huawei.com [groeck: Fixed some multi-line alignment issues; reverted to 32-bit arithmetic in power1_accuracy_show() fixed bad return code from power_meter_is_visible()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions