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-bq4802.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-bq4802.c')
-rw-r--r-- | drivers/rtc/rtc-bq4802.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-bq4802.c b/drivers/rtc/rtc-bq4802.c index d00a274df8fc..280fe48ada0b 100644 --- a/drivers/rtc/rtc-bq4802.c +++ b/drivers/rtc/rtc-bq4802.c | |||
@@ -169,6 +169,8 @@ static int __devinit bq4802_probe(struct platform_device *pdev) | |||
169 | goto out_free; | 169 | goto out_free; |
170 | } | 170 | } |
171 | 171 | ||
172 | platform_set_drvdata(pdev, p); | ||
173 | |||
172 | p->rtc = rtc_device_register("bq4802", &pdev->dev, | 174 | p->rtc = rtc_device_register("bq4802", &pdev->dev, |
173 | &bq4802_ops, THIS_MODULE); | 175 | &bq4802_ops, THIS_MODULE); |
174 | if (IS_ERR(p->rtc)) { | 176 | if (IS_ERR(p->rtc)) { |
@@ -176,7 +178,6 @@ static int __devinit bq4802_probe(struct platform_device *pdev) | |||
176 | goto out_iounmap; | 178 | goto out_iounmap; |
177 | } | 179 | } |
178 | 180 | ||
179 | platform_set_drvdata(pdev, p); | ||
180 | err = 0; | 181 | err = 0; |
181 | out: | 182 | out: |
182 | return err; | 183 | return err; |