[PATCH] hwmon: (acpi_power_meter) Convert to use hwmon_device_register_with_info() API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since hwmon_device_register() has been deprecated and gives warning in
dmesg, just convert it to hwmon_device_register_with_info() with name
strings.

Only difference is that now name sysfs file is created under top hwmon
directory. i.e.:
 $ cat /sys/class/hwmon/hwmonX/name
 $ power_meter

Other than that, nothing has changed.

Signed-off-by: Misono Tomohiro <misono.tomohiro@xxxxxxxxxxxxxx>
---
 drivers/hwmon/acpi_power_meter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index a270b975e90b..d93a5423d7ae 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -885,7 +885,8 @@ static int acpi_power_meter_add(struct acpi_device *device)
 	if (res)
 		goto exit_free_capability;
 
-	resource->hwmon_dev = hwmon_device_register(&device->dev);
+	resource->hwmon_dev = hwmon_device_register_with_info(&device->dev,
+					ACPI_POWER_METER_NAME, NULL, NULL, NULL);
 	if (IS_ERR(resource->hwmon_dev)) {
 		res = PTR_ERR(resource->hwmon_dev);
 		goto exit_remove;
-- 
2.21.3




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux