diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-28 19:23:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-28 19:23:27 -0400 |
commit | 2ff712585a5026a021859233fce145068292584d (patch) | |
tree | 1dda6f9fa831be1267cafe260932f0abfccc4583 /drivers/hwmon/w83l785ts.c | |
parent | 6174d0fd35f486f59b743630bdf088a9f9792d4d (diff) | |
parent | 3379ceeefde923a05c2c77ed2d84ba26c2fe9e81 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/hwmon-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/hwmon-2.6: (39 commits)
hwmon: Remove Yuan Mu's address
hwmon: Fix unchecked return status, SMSC chips
hwmon: Fix unchecked return status, batch 6
w83792d: Fix unchecked return status
w83l785ts: Fix unchecked return status
w83781d: Fix unchecked return status
vt8231: Fix unchecked return status
Fix unchecked return status, batch 5
hwmon: Fix unchecked return status, batch 4
hwmon: Fix unchecked return status, batch 3
hwmon: Fix unchecked return status, batch 2
w83627ehf: Fix unchecked return status
pc87360: Check for error on sysfs files creation
pc87360: Delete sysfs files on device deletion
pc87360: Move some code around
hwmon: Fix unchecked return status, batch 1
vt1211: Document module parameters
vt1211: Add documentation
hwmon: New driver for the VIA VT1211
w83791d: Documentation update
...
Diffstat (limited to 'drivers/hwmon/w83l785ts.c')
-rw-r--r-- | drivers/hwmon/w83l785ts.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c index 3f2bac125fb1..a3fcace412f0 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c | |||
@@ -236,21 +236,30 @@ static int w83l785ts_detect(struct i2c_adapter *adapter, int address, int kind) | |||
236 | * Nothing yet, assume it is already started. | 236 | * Nothing yet, assume it is already started. |
237 | */ | 237 | */ |
238 | 238 | ||
239 | err = device_create_file(&new_client->dev, | ||
240 | &sensor_dev_attr_temp1_input.dev_attr); | ||
241 | if (err) | ||
242 | goto exit_remove; | ||
243 | |||
244 | err = device_create_file(&new_client->dev, | ||
245 | &sensor_dev_attr_temp1_max.dev_attr); | ||
246 | if (err) | ||
247 | goto exit_remove; | ||
248 | |||
239 | /* Register sysfs hooks */ | 249 | /* Register sysfs hooks */ |
240 | data->class_dev = hwmon_device_register(&new_client->dev); | 250 | data->class_dev = hwmon_device_register(&new_client->dev); |
241 | if (IS_ERR(data->class_dev)) { | 251 | if (IS_ERR(data->class_dev)) { |
242 | err = PTR_ERR(data->class_dev); | 252 | err = PTR_ERR(data->class_dev); |
243 | goto exit_detach; | 253 | goto exit_remove; |
244 | } | 254 | } |
245 | 255 | ||
246 | device_create_file(&new_client->dev, | ||
247 | &sensor_dev_attr_temp1_input.dev_attr); | ||
248 | device_create_file(&new_client->dev, | ||
249 | &sensor_dev_attr_temp1_max.dev_attr); | ||
250 | |||
251 | return 0; | 256 | return 0; |
252 | 257 | ||
253 | exit_detach: | 258 | exit_remove: |
259 | device_remove_file(&new_client->dev, | ||
260 | &sensor_dev_attr_temp1_input.dev_attr); | ||
261 | device_remove_file(&new_client->dev, | ||
262 | &sensor_dev_attr_temp1_max.dev_attr); | ||
254 | i2c_detach_client(new_client); | 263 | i2c_detach_client(new_client); |
255 | exit_free: | 264 | exit_free: |
256 | kfree(data); | 265 | kfree(data); |
@@ -264,7 +273,10 @@ static int w83l785ts_detach_client(struct i2c_client *client) | |||
264 | int err; | 273 | int err; |
265 | 274 | ||
266 | hwmon_device_unregister(data->class_dev); | 275 | hwmon_device_unregister(data->class_dev); |
267 | 276 | device_remove_file(&client->dev, | |
277 | &sensor_dev_attr_temp1_input.dev_attr); | ||
278 | device_remove_file(&client->dev, | ||
279 | &sensor_dev_attr_temp1_max.dev_attr); | ||
268 | if ((err = i2c_detach_client(client))) | 280 | if ((err = i2c_detach_client(client))) |
269 | return err; | 281 | return err; |
270 | 282 | ||