diff options
author | Alessandro Zummo <alessandro.zummo@towertech.it> | 2009-12-15 19:45:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:19:58 -0500 |
commit | b74d2caa64f8e542e9c6716ae6ed4a60d681ea9f (patch) | |
tree | 3d34fb87043b4a800bd35455725ba81638541cc3 /drivers/rtc/rtc-v3020.c | |
parent | d1b2efa83fbf7b33919238fa29ef6ab935820103 (diff) |
rtc: fix driver data issues in several rtc drivers
Herton Ronaldo Krzesinski recently raised up, and fixed, an issue with the
rtc_cmos driver, which was referring to an inconsistent driver data.
This patch ensures that driver data registration happens before
rtc_device_register().
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Thomas Hommel <thomas.hommel@gefanuc.com>
Acked-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Andrew Sharp <andy.sharp@onstor.com>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alexander Bigga <ab@mycable.de>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Mark Zhan <rongkai.zhan@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-v3020.c')
-rw-r--r-- | drivers/rtc/rtc-v3020.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c index ad741afd47d8..bed4cab07043 100644 --- a/drivers/rtc/rtc-v3020.c +++ b/drivers/rtc/rtc-v3020.c | |||
@@ -304,7 +304,6 @@ static int rtc_probe(struct platform_device *pdev) | |||
304 | { | 304 | { |
305 | struct v3020_platform_data *pdata = pdev->dev.platform_data; | 305 | struct v3020_platform_data *pdata = pdev->dev.platform_data; |
306 | struct v3020 *chip; | 306 | struct v3020 *chip; |
307 | struct rtc_device *rtc; | ||
308 | int retval = -EBUSY; | 307 | int retval = -EBUSY; |
309 | int i; | 308 | int i; |
310 | int temp; | 309 | int temp; |
@@ -353,13 +352,12 @@ static int rtc_probe(struct platform_device *pdev) | |||
353 | 352 | ||
354 | platform_set_drvdata(pdev, chip); | 353 | platform_set_drvdata(pdev, chip); |
355 | 354 | ||
356 | rtc = rtc_device_register("v3020", | 355 | chip->rtc = rtc_device_register("v3020", |
357 | &pdev->dev, &v3020_rtc_ops, THIS_MODULE); | 356 | &pdev->dev, &v3020_rtc_ops, THIS_MODULE); |
358 | if (IS_ERR(rtc)) { | 357 | if (IS_ERR(chip->rtc)) { |
359 | retval = PTR_ERR(rtc); | 358 | retval = PTR_ERR(chip->rtc); |
360 | goto err_io; | 359 | goto err_io; |
361 | } | 360 | } |
362 | chip->rtc = rtc; | ||
363 | 361 | ||
364 | return 0; | 362 | return 0; |
365 | 363 | ||