diff options
Diffstat (limited to 'drivers/rtc/rtc-x1205.c')
-rw-r--r-- | drivers/rtc/rtc-x1205.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index 522c69753bbf..9a67487d086b 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c | |||
@@ -562,11 +562,19 @@ static int x1205_probe(struct i2c_adapter *adapter, int address, int kind) | |||
562 | else | 562 | else |
563 | dev_err(&client->dev, "couldn't read status\n"); | 563 | dev_err(&client->dev, "couldn't read status\n"); |
564 | 564 | ||
565 | device_create_file(&client->dev, &dev_attr_atrim); | 565 | err = device_create_file(&client->dev, &dev_attr_atrim); |
566 | device_create_file(&client->dev, &dev_attr_dtrim); | 566 | if (err) goto exit_devreg; |
567 | err = device_create_file(&client->dev, &dev_attr_dtrim); | ||
568 | if (err) goto exit_atrim; | ||
567 | 569 | ||
568 | return 0; | 570 | return 0; |
569 | 571 | ||
572 | exit_atrim: | ||
573 | device_remove_file(&client->dev, &dev_attr_atrim); | ||
574 | |||
575 | exit_devreg: | ||
576 | rtc_device_unregister(rtc); | ||
577 | |||
570 | exit_detach: | 578 | exit_detach: |
571 | i2c_detach_client(client); | 579 | i2c_detach_client(client); |
572 | 580 | ||