diff mbox series

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

Message ID e5390907-9112-4aca-e2e8-acf4097bf941@radiodata.biz (mailing list archive)
State Changes Requested
Headers show
Series [PATCHv2] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace | expand

Commit Message

Christian Schneider June 14, 2019, 3:35 p.m. UTC
Alarms on gpio-fan can't be received from sysfs_notify, because the 
wrong kobject is passed.
This patch fixes this.

Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
---

Comments

Guenter Roeck June 15, 2019, 1:17 p.m. UTC | #1
On 6/14/19 8:35 AM, Christian Schneider wrote:
> Alarms on gpio-fan can't be received from sysfs_notify, because the wrong kobject is passed.
> This patch fixes this.
> 
> Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
> ---
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index 84753680a4e8..76377791ff0e 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)
> 
The patch is whitespace damaged (cut-and-paste, maybe ?) and does not apply.
Can you send it with git send-email, possibly ?

Thanks,
Guenter
Christian Schneider June 17, 2019, 9:36 a.m. UTC | #2
sent again with git send-email.
Sorry for hazzle...

Am 15.06.2019 um 14:17 schrieb Guenter Roeck:
> On 6/14/19 8:35 AM, Christian Schneider wrote:
>> Alarms on gpio-fan can't be received from sysfs_notify, because the 
>> wrong kobject is passed.
>> This patch fixes this.
>>
>> Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
>> ---
>> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
>> index 84753680a4e8..76377791ff0e 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)
>>
> The patch is whitespace damaged (cut-and-paste, maybe ?) and does not 
> apply.
> Can you send it with git send-email, possibly ?
> 
> Thanks,
> Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 84753680a4e8..76377791ff0e 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)