From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbdGBAFb (ORCPT ); Sat, 1 Jul 2017 20:05:31 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33394 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbdGBAFa (ORCPT ); Sat, 1 Jul 2017 20:05:30 -0400 From: Cengiz Can To: Henrik Rydberg Cc: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Cengiz Can Subject: [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call Date: Sun, 2 Jul 2017 03:05:05 +0300 Message-Id: <20170702000505.2650-1-cengizc@gmail.com> X-Mailer: git-send-email 2.13.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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