diff mbox series

[2/2] hwmon: gpio-fan: fix sysfs notifications and udev events for gpio-fan alarms

Message ID 20190702132338.8856-2-cschneider@radiodata.biz (mailing list archive)
State Accepted
Headers show
Series [1/2] hwmon: gpio-fan: move fan_alarm_init after devm_hwmon_device_register_with_groups | expand

Commit Message

Christian Schneider July 2, 2019, 1:23 p.m. UTC
From: Christian Schneider <cschneider@radiodata.biz>

sysfs_notify() and kobject_uevent() are passed the wrong device.
fan_data->hwmon_dev needs to be passed, so that sysfs notification
goes to right place and generated uevent has the right information

Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
---
 drivers/hwmon/gpio-fan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index a962a9ee7225..36bca2d75e0f 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -54,8 +54,8 @@  static void fan_alarm_notify(struct work_struct *ws)
 	struct gpio_fan_data *fan_data =
 		container_of(ws, struct gpio_fan_data, alarm_work);
 
-	sysfs_notify(&fan_data->dev->kobj, NULL, "fan1_alarm");
-	kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
+	sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
+	kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE);
 }
 
 static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)