summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ds1672.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-12-06 20:35:34 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:31 -0800
commit91046a8a693823d434f0aa70419c48ebeb8e1b11 (patch)
tree10eb9325fa0a929f00b24485ad3031726c8ba57d /drivers/rtc/rtc-ds1672.c
parentbfc7ee207078e8ca51264355805e6f56b485be4b (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-ds1672.c')
-rw-r--r--drivers/rtc/rtc-ds1672.c9
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)
/* read control register */
err = ds1672_get_control(client, &control);
if (err)
- goto exit_detach;
+ goto exit_devreg;
if (control & DS1672_REG_CONTROL_EOSC)
dev_warn(&client->dev, "Oscillator not enabled. "
"Set time to enable.\n");
/* Register sysfs hooks */
- device_create_file(&client->dev, &dev_attr_control);
+ err = device_create_file(&client->dev, &dev_attr_control);
+ if (err)
+ goto exit_devreg;
return 0;
+exit_devreg:
+ rtc_device_unregister(rtc);
+
exit_detach:
i2c_detach_client(client);