Skip to contentSkip to conversation

hwmon: gpio-fan: fix sysfs notifications and udev events for gpio-fan alarms

PATCH Guenter Roeck 1 participant 1 message Jul 2, 2019 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer Applied
#0 lore raw
Quoted 7 lines · On Tue, Jul 02, 2019 at 03:23:38PM +0200, [email protected] wrote:

From: Christian Schneider <[email protected]>

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

Applied.

Thanks,
Guenter

Quoted 22 lines
---
 drivers/hwmon/gpio-fan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/gpio-fan.c +2 -2
index a962a9ee7225..36bca2d75e0f 100644
@@ -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)
Signature · 1 line
2.22.0