[PATCH] hwmon: Fix the 'No sensors found' error after replacing the parameter NULL by the actual device

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

 



In __hwmon_device_register() function of hwmon.c, we have assigned 'dev' directly to 'hdev->parent'. 
Formerly, when registering the hwmon device, we pass NULL as the device. This is not affected.
Recently, the developer has replaced the parameter NULL as the device by the actual device.
This causes the "No sensors found" error. This patch is to fix this error.

This patch is based on the v4.19-rc3 tag.

---
 drivers/hwmon/hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index 33d5128..7c8d3cb 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -610,7 +610,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
 
 	hwdev->name = name;
 	hdev->class = &hwmon_class;
-	hdev->parent = dev;
+	hdev->parent = dev->parent;
 	hdev->of_node = dev ? dev->of_node : NULL;
 	hwdev->chip = chip;
 	dev_set_drvdata(hdev, drvdata);
-- 
2.7.4




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux