diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-06 23:35:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:31 -0500 |
commit | 91046a8a693823d434f0aa70419c48ebeb8e1b11 (patch) | |
tree | 10eb9325fa0a929f00b24485ad3031726c8ba57d /drivers/rtc/rtc-rs5c372.c | |
parent | bfc7ee207078e8ca51264355805e6f56b485be4b (diff) |
[PATCH] RTC: handle sysfs errors
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/rtc/rtc-rs5c372.c')
-rw-r--r-- | drivers/rtc/rtc-rs5c372.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index a44fe4efa216..9e1bb3a72f7a 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c | |||
@@ -238,11 +238,19 @@ static int rs5c372_probe(struct i2c_adapter *adapter, int address, int kind) | |||
238 | 238 | ||
239 | i2c_set_clientdata(client, rtc); | 239 | i2c_set_clientdata(client, rtc); |
240 | 240 | ||
241 | device_create_file(&client->dev, &dev_attr_trim); | 241 | err = device_create_file(&client->dev, &dev_attr_trim); |
242 | device_create_file(&client->dev, &dev_attr_osc); | 242 | if (err) goto exit_devreg; |
243 | err = device_create_file(&client->dev, &dev_attr_osc); | ||
244 | if (err) goto exit_trim; | ||
243 | 245 | ||
244 | return 0; | 246 | return 0; |
245 | 247 | ||
248 | exit_trim: | ||
249 | device_remove_file(&client->dev, &dev_attr_trim); | ||
250 | |||
251 | exit_devreg: | ||
252 | rtc_device_unregister(rtc); | ||
253 | |||
246 | exit_detach: | 254 | exit_detach: |
247 | i2c_detach_client(client); | 255 | i2c_detach_client(client); |
248 | 256 | ||