From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
To: <linux@roeck-us.net>, <linux-hwmon@vger.kernel.org>
Cc: <misono.tomohiro@jp.fujitsu.com>
Subject: [PATCH] hwmon: (acpi_power_meter) Convert to use hwmon_device_register_with_info() API
Date: Thu, 25 Jun 2020 16:31:09 +0900 [thread overview]
Message-ID: <20200625073109.13993-1-misono.tomohiro@jp.fujitsu.com> (raw)
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@jp.fujitsu.com>
---
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
next reply other threads:[~2020-06-25 7:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 7:31 Misono Tomohiro [this message]
2020-06-25 13:45 ` [PATCH] hwmon: (acpi_power_meter) Convert to use hwmon_device_register_with_info() API Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200625073109.13993-1-misono.tomohiro@jp.fujitsu.com \
--to=misono.tomohiro@jp.fujitsu.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).