aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rs5c372.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-rs5c372.c')
-rw-r--r--drivers/rtc/rtc-rs5c372.c12
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
248exit_trim:
249 device_remove_file(&client->dev, &dev_attr_trim);
250
251exit_devreg:
252 rtc_device_unregister(rtc);
253
246exit_detach: 254exit_detach:
247 i2c_detach_client(client); 255 i2c_detach_client(client);
248 256