diff options
Diffstat (limited to 'drivers/hwmon/w83l785ts.c')
-rw-r--r-- | drivers/hwmon/w83l785ts.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c index 20781def65ed..5f14e3897058 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c | |||
@@ -86,7 +86,7 @@ static struct w83l785ts_data *w83l785ts_update_device(struct device *dev); | |||
86 | /* | 86 | /* |
87 | * Driver data (common to all clients) | 87 | * Driver data (common to all clients) |
88 | */ | 88 | */ |
89 | 89 | ||
90 | static const struct i2c_device_id w83l785ts_id[] = { | 90 | static const struct i2c_device_id w83l785ts_id[] = { |
91 | { "w83l785ts", 0 }, | 91 | { "w83l785ts", 0 }, |
92 | { } | 92 | { } |
@@ -116,8 +116,7 @@ struct w83l785ts_data { | |||
116 | unsigned long last_updated; /* in jiffies */ | 116 | unsigned long last_updated; /* in jiffies */ |
117 | 117 | ||
118 | /* registers values */ | 118 | /* registers values */ |
119 | s8 temp[2]; /* 0: input | 119 | s8 temp[2]; /* 0: input, 1: critical limit */ |
120 | 1: critical limit */ | ||
121 | }; | 120 | }; |
122 | 121 | ||
123 | /* | 122 | /* |
@@ -250,8 +249,10 @@ static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval) | |||
250 | struct device *dev; | 249 | struct device *dev; |
251 | const char *prefix; | 250 | const char *prefix; |
252 | 251 | ||
253 | /* We might be called during detection, at which point the client | 252 | /* |
254 | isn't yet fully initialized, so we can't use dev_dbg on it */ | 253 | * We might be called during detection, at which point the client |
254 | * isn't yet fully initialized, so we can't use dev_dbg on it | ||
255 | */ | ||
255 | if (i2c_get_clientdata(client)) { | 256 | if (i2c_get_clientdata(client)) { |
256 | dev = &client->dev; | 257 | dev = &client->dev; |
257 | prefix = ""; | 258 | prefix = ""; |
@@ -260,9 +261,11 @@ static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval) | |||
260 | prefix = "w83l785ts: "; | 261 | prefix = "w83l785ts: "; |
261 | } | 262 | } |
262 | 263 | ||
263 | /* Frequent read errors have been reported on Asus boards, so we | 264 | /* |
265 | * Frequent read errors have been reported on Asus boards, so we | ||
264 | * retry on read errors. If it still fails (unlikely), return the | 266 | * retry on read errors. If it still fails (unlikely), return the |
265 | * default value requested by the caller. */ | 267 | * default value requested by the caller. |
268 | */ | ||
266 | for (i = 1; i <= MAX_RETRIES; i++) { | 269 | for (i = 1; i <= MAX_RETRIES; i++) { |
267 | value = i2c_smbus_read_byte_data(client, reg); | 270 | value = i2c_smbus_read_byte_data(client, reg); |
268 | if (value >= 0) { | 271 | if (value >= 0) { |
@@ -302,19 +305,8 @@ static struct w83l785ts_data *w83l785ts_update_device(struct device *dev) | |||
302 | return data; | 305 | return data; |
303 | } | 306 | } |
304 | 307 | ||
305 | static int __init sensors_w83l785ts_init(void) | 308 | module_i2c_driver(w83l785ts_driver); |
306 | { | ||
307 | return i2c_add_driver(&w83l785ts_driver); | ||
308 | } | ||
309 | |||
310 | static void __exit sensors_w83l785ts_exit(void) | ||
311 | { | ||
312 | i2c_del_driver(&w83l785ts_driver); | ||
313 | } | ||
314 | 309 | ||
315 | MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>"); | 310 | MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>"); |
316 | MODULE_DESCRIPTION("W83L785TS-S driver"); | 311 | MODULE_DESCRIPTION("W83L785TS-S driver"); |
317 | MODULE_LICENSE("GPL"); | 312 | MODULE_LICENSE("GPL"); |
318 | |||
319 | module_init(sensors_w83l785ts_init); | ||
320 | module_exit(sensors_w83l785ts_exit); | ||