summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-stk17ta8.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-stk17ta8.c')
-rw-r--r--drivers/rtc/rtc-stk17ta8.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
index d491eb2..62c2969 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -288,7 +288,6 @@ static struct bin_attribute stk17ta8_nvram_attr = {
static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
{
- struct rtc_device *rtc;
struct resource *res;
unsigned int cal;
unsigned int flags;
@@ -338,22 +337,23 @@ static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
}
}
- rtc = rtc_device_register(pdev->name, &pdev->dev,
+ pdata->last_jiffies = jiffies;
+ platform_set_drvdata(pdev, pdata);
+
+ pdata->rtc = rtc_device_register(pdev->name, &pdev->dev,
&stk17ta8_rtc_ops, THIS_MODULE);
- if (IS_ERR(rtc)) {
- ret = PTR_ERR(rtc);
+ if (IS_ERR(pdata->rtc)) {
+ ret = PTR_ERR(pdata->rtc);
goto out;
}
- pdata->rtc = rtc;
- pdata->last_jiffies = jiffies;
- platform_set_drvdata(pdev, pdata);
+
ret = sysfs_create_bin_file(&pdev->dev.kobj, &stk17ta8_nvram_attr);
- if (ret)
+ if (ret) {
+ rtc_device_unregister(pdata->rtc);
goto out;
+ }
return 0;
out:
- if (pdata->rtc)
- rtc_device_unregister(pdata->rtc);
if (pdata->irq > 0)
free_irq(pdata->irq, pdev);
if (ioaddr)
OpenPOWER on IntegriCloud