aboutsummaryrefslogtreecommitdiffstats
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 d491eb265c38..62c2969436a8 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -288,7 +288,6 @@ static struct bin_attribute stk17ta8_nvram_attr = {
288 288
289static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev) 289static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
290{ 290{
291 struct rtc_device *rtc;
292 struct resource *res; 291 struct resource *res;
293 unsigned int cal; 292 unsigned int cal;
294 unsigned int flags; 293 unsigned int flags;
@@ -338,22 +337,23 @@ static int __devinit stk17ta8_rtc_probe(struct platform_device *pdev)
338 } 337 }
339 } 338 }
340 339
341 rtc = rtc_device_register(pdev->name, &pdev->dev, 340 pdata->last_jiffies = jiffies;
341 platform_set_drvdata(pdev, pdata);
342
343 pdata->rtc = rtc_device_register(pdev->name, &pdev->dev,
342 &stk17ta8_rtc_ops, THIS_MODULE); 344 &stk17ta8_rtc_ops, THIS_MODULE);
343 if (IS_ERR(rtc)) { 345 if (IS_ERR(pdata->rtc)) {
344 ret = PTR_ERR(rtc); 346 ret = PTR_ERR(pdata->rtc);
345 goto out; 347 goto out;
346 } 348 }
347 pdata->rtc = rtc; 349
348 pdata->last_jiffies = jiffies;
349 platform_set_drvdata(pdev, pdata);
350 ret = sysfs_create_bin_file(&pdev->dev.kobj, &stk17ta8_nvram_attr); 350 ret = sysfs_create_bin_file(&pdev->dev.kobj, &stk17ta8_nvram_attr);
351 if (ret) 351 if (ret) {
352 rtc_device_unregister(pdata->rtc);
352 goto out; 353 goto out;
354 }
353 return 0; 355 return 0;
354 out: 356 out:
355 if (pdata->rtc)
356 rtc_device_unregister(pdata->rtc);
357 if (pdata->irq > 0) 357 if (pdata->irq > 0)
358 free_irq(pdata->irq, pdev); 358 free_irq(pdata->irq, pdev);
359 if (ioaddr) 359 if (ioaddr)