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>
This commit is contained in:
committed by
Linus Torvalds
parent
d1b2efa83f
commit
b74d2caa64
@@ -277,6 +277,8 @@ static int pcf8583_probe(struct i2c_client *client,
|
||||
if (!pcf8583)
|
||||
return -ENOMEM;
|
||||
|
||||
i2c_set_clientdata(client, pcf8583);
|
||||
|
||||
pcf8583->rtc = rtc_device_register(pcf8583_driver.driver.name,
|
||||
&client->dev, &pcf8583_rtc_ops, THIS_MODULE);
|
||||
|
||||
@@ -285,7 +287,6 @@ static int pcf8583_probe(struct i2c_client *client,
|
||||
goto exit_kfree;
|
||||
}
|
||||
|
||||
i2c_set_clientdata(client, pcf8583);
|
||||
return 0;
|
||||
|
||||
exit_kfree:
|
||||
|
Reference in New Issue
Block a user