Re: [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace

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

 



Am 14.06.2019 um 15:05 schrieb Guenter Roeck:
On 6/14/19 6:52 AM, Christian Schneider wrote:
From: Christian Schneider <cschneider@xxxxxxxxxxxxx>
   To: linux-hwmon

The above should not be part of the e-mail body.

Alarms on gpio-fan can't be received from sysfs_notify, because the wrong kobject is passed.
This patch fixes this.

Empty line here please.

Signed-off-by: Christian Schneider <cschneider@xxxxxxxxxxxxx>
---
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 84753680a4e8..5f3a35db18a1 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -54,7 +54,7 @@ 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");
+       sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
         kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
  }

You'll want to make the same change for kobject_uevent().

Actually, uevents are send and can be received as is. I have tried changing the kobject for kobject_uevent(), too, and only the content of the uevent changes.
Since I don't know what would be the "right" one, I left it as is.
If you say, that it would be correct with the hwmon_dev kobject, I'll add this to the patch.


Thanks,
Guenter



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux