Commit a7a5731a authored by Cosmin Tanislav's avatar Cosmin Tanislav Committed by Guenter Roeck

hwmon: (adt7x10) Use hwmon_notify_event

The hwmon subsystem provides means of notifying userspace
about events. Use it.
Signed-off-by: default avatarCosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20211221215841.2641417-8-demonsingur@gmail.com
[groeck: Pass hwmon device to interrupt handler]
Tested-by: default avatarCosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: default avatarCosmin Tanislav <cosmin.tanislav@analog.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 8331585a
...@@ -87,11 +87,11 @@ static irqreturn_t adt7x10_irq_handler(int irq, void *private) ...@@ -87,11 +87,11 @@ static irqreturn_t adt7x10_irq_handler(int irq, void *private)
return IRQ_HANDLED; return IRQ_HANDLED;
if (status & ADT7X10_STAT_T_HIGH) if (status & ADT7X10_STAT_T_HIGH)
sysfs_notify(&dev->kobj, NULL, "temp1_max_alarm"); hwmon_notify_event(dev, hwmon_temp, hwmon_temp_max_alarm, 0);
if (status & ADT7X10_STAT_T_LOW) if (status & ADT7X10_STAT_T_LOW)
sysfs_notify(&dev->kobj, NULL, "temp1_min_alarm"); hwmon_notify_event(dev, hwmon_temp, hwmon_temp_min_alarm, 0);
if (status & ADT7X10_STAT_T_CRIT) if (status & ADT7X10_STAT_T_CRIT)
sysfs_notify(&dev->kobj, NULL, "temp1_crit_alarm"); hwmon_notify_event(dev, hwmon_temp, hwmon_temp_crit_alarm, 0);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -388,7 +388,7 @@ int adt7x10_probe(struct device *dev, const char *name, int irq, ...@@ -388,7 +388,7 @@ int adt7x10_probe(struct device *dev, const char *name, int irq,
adt7x10_irq_handler, adt7x10_irq_handler,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_FALLING |
IRQF_ONESHOT, IRQF_ONESHOT,
dev_name(dev), dev); dev_name(dev), hdev);
if (ret) if (ret)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment