On 6/25/20 12:31 AM, Misono Tomohiro wrote: > 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; > NACK This is not acceptable and an API abuse. I'll have to make the API more restrictive to avoid such abuse. Guenter