aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-test.c')
-rw-r--r--drivers/rtc/rtc-test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 6ef9c62d5032..f50a1b8e1607 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -123,11 +123,18 @@ static int test_probe(struct platform_device *plat_dev)
123 err = PTR_ERR(rtc); 123 err = PTR_ERR(rtc);
124 return err; 124 return err;
125 } 125 }
126 device_create_file(&plat_dev->dev, &dev_attr_irq); 126
127 err = device_create_file(&plat_dev->dev, &dev_attr_irq);
128 if (err)
129 goto err;
127 130
128 platform_set_drvdata(plat_dev, rtc); 131 platform_set_drvdata(plat_dev, rtc);
129 132
130 return 0; 133 return 0;
134
135err:
136 rtc_device_unregister(rtc);
137 return err;
131} 138}
132 139
133static int __devexit test_remove(struct platform_device *plat_dev) 140static int __devexit test_remove(struct platform_device *plat_dev)