Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292121
b: refs/heads/master
c: 96585f1
h: refs/heads/master
i:
  292119: e135db3
v: v3
  • Loading branch information
Frans Meulenbroeks authored and Guenter Roeck committed Mar 19, 2012
1 parent 70088bc commit bc78ec3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a9e7c4c0365e246d85166a5ee04a8dd4dcfada9
refs/heads/master: 96585f1ae4698800a18582935e2f01bb65a44fe6
6 changes: 6 additions & 0 deletions trunk/drivers/hwmon/lm80.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static inline long TEMP_FROM_REG(u16 temp)
struct lm80_data {
struct device *hwmon_dev;
struct mutex update_lock;
char error; /* !=0 if error occurred during last update */
char valid; /* !=0 if following fields are valid */
unsigned long last_updated; /* In jiffies */

Expand Down Expand Up @@ -595,6 +596,9 @@ static struct lm80_data *lm80_update_device(struct device *dev)

mutex_lock(&data->update_lock);

if (data->error)
lm80_init_client(client);

if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) {
dev_dbg(&client->dev, "Starting lm80 update\n");
for (i = 0; i <= 6; i++) {
Expand Down Expand Up @@ -678,12 +682,14 @@ static struct lm80_data *lm80_update_device(struct device *dev)

data->last_updated = jiffies;
data->valid = 1;
data->error = 0;
}
goto done;

abort:
ret = ERR_PTR(rv);
data->valid = 0;
data->error = 1;

done:
mutex_unlock(&data->update_lock);
Expand Down

0 comments on commit bc78ec3

Please sign in to comment.