Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1679413
| From | Cengiz Can <cengizc@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call |
| Date | 2017-07-02 02:10 +0200 |
| Message-ID | <tYACB-233-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Hello.
This is my first patch attempt on drivers so I might be completely wrong.
applesmc driver was using the deprecated `hwmon_device_register` call for
some reason. And that causes a deprecation warning in dmesg.
I've replaced the call with `hwmon_device_register_with_info` and booted
my MBP 11,2 with it.
The warning is no longer shown. And the functionality doesn't seem to be
broken.
Thank you for reading this.
Signed-off-by: Cengiz Can <cengizc@gmail.com>
---
drivers/hwmon/applesmc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 0af7fd311979..6e897310151a 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -1326,7 +1326,11 @@ static int __init applesmc_init(void)
if (ret)
goto out_light_sysfs;
- hwmon_dev = hwmon_device_register(&pdev->dev);
+ hwmon_dev = hwmon_device_register_with_info(&pdev->dev,
+ "applesmcbacklight",
+ NULL,
+ NULL,
+ NULL);
if (IS_ERR(hwmon_dev)) {
ret = PTR_ERR(hwmon_dev);
goto out_light_ledclass;
--
2.13.2
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call Cengiz Can <cengizc@gmail.com> - 2017-07-02 02:10 +0200
csiph-web