diff options
Diffstat (limited to 'drivers/rtc/rtc-ds1672.c')
-rw-r--r-- | drivers/rtc/rtc-ds1672.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c index 67e816a9a39f..dfef1637bfb8 100644 --- a/drivers/rtc/rtc-ds1672.c +++ b/drivers/rtc/rtc-ds1672.c | |||
@@ -237,17 +237,22 @@ static int ds1672_probe(struct i2c_adapter *adapter, int address, int kind) | |||
237 | /* read control register */ | 237 | /* read control register */ |
238 | err = ds1672_get_control(client, &control); | 238 | err = ds1672_get_control(client, &control); |
239 | if (err) | 239 | if (err) |
240 | goto exit_detach; | 240 | goto exit_devreg; |
241 | 241 | ||
242 | if (control & DS1672_REG_CONTROL_EOSC) | 242 | if (control & DS1672_REG_CONTROL_EOSC) |
243 | dev_warn(&client->dev, "Oscillator not enabled. " | 243 | dev_warn(&client->dev, "Oscillator not enabled. " |
244 | "Set time to enable.\n"); | 244 | "Set time to enable.\n"); |
245 | 245 | ||
246 | /* Register sysfs hooks */ | 246 | /* Register sysfs hooks */ |
247 | device_create_file(&client->dev, &dev_attr_control); | 247 | err = device_create_file(&client->dev, &dev_attr_control); |
248 | if (err) | ||
249 | goto exit_devreg; | ||
248 | 250 | ||
249 | return 0; | 251 | return 0; |
250 | 252 | ||
253 | exit_devreg: | ||
254 | rtc_device_unregister(rtc); | ||
255 | |||
251 | exit_detach: | 256 | exit_detach: |
252 | i2c_detach_client(client); | 257 | i2c_detach_client(client); |
253 | 258 | ||