linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] hwmon: gpio-fan: fix sysfs notifications and udev events for gpio-fan alarms
@ 2019-07-02 13:39 Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-07-02 13:39 UTC (permalink / raw)
  To: cschneider; +Cc: linux-hwmon, christian

On Tue, Jul 02, 2019 at 03:23:38PM +0200, cschneider@radiodata.biz wrote:
> 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>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/gpio-fan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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)
> -- 
> 2.22.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] hwmon: gpio-fan: fix sysfs notifications and udev events for gpio-fan alarms
  2019-07-02 13:23 [PATCH 1/2] hwmon: gpio-fan: move fan_alarm_init after devm_hwmon_device_register_with_groups cschneider
@ 2019-07-02 13:23 ` cschneider
  0 siblings, 0 replies; 2+ messages in thread
From: cschneider @ 2019-07-02 13:23 UTC (permalink / raw)
  To: linux-hwmon; +Cc: christian, linux, cschneider

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 --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)
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-02 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 13:39 [PATCH 2/2] hwmon: gpio-fan: fix sysfs notifications and udev events for gpio-fan alarms Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2019-07-02 13:23 [PATCH 1/2] hwmon: gpio-fan: move fan_alarm_init after devm_hwmon_device_register_with_groups cschneider
2019-07-02 13:23 ` [PATCH 2/2] hwmon: gpio-fan: fix sysfs notifications and udev events for gpio-fan alarms cschneider

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).