Commit b1526b38 authored by Guenter Roeck's avatar Guenter Roeck
Browse files

hwmon: (lm90) Only disable alerts if not already disabled



It was observed that the alert handler may be called from the i2c core
even after alerts have already been disabled. Only disable alerts if
they have not already been disabled.

Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 41e6d721
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2660,8 +2660,10 @@ static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type,

		if ((data->flags & LM90_HAVE_BROKEN_ALERT) &&
		    (data->current_alarms & data->alert_alarms)) {
			if (!(data->config & 0x80)) {
				dev_dbg(&client->dev, "Disabling ALERT#\n");
				lm90_update_confreg(data, data->config | 0x80);
			}
			schedule_delayed_work(&data->alert_work,
				max_t(int, HZ, msecs_to_jiffies(data->update_interval)));
		}