From b74d2caa64f8e542e9c6716ae6ed4a60d681ea9f Mon Sep 17 00:00:00 2001 From: Alessandro Zummo Date: Tue, 15 Dec 2009 16:45:53 -0800 Subject: 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 Acked-by: Thomas Hommel Acked-by: Hans-Christian Egtvedt Acked-by: Paul Mundt Cc: David S. Miller Cc: Thomas Bogendoerfer Cc: Andrew Sharp Cc: Atsushi Nemoto Cc: Alexander Bigga Cc: Thomas Bogendoerfer Cc: Mark Zhan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-pcf8583.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/rtc/rtc-pcf8583.c') diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c index 7d33cda3f8f6..2d201afead3b 100644 --- a/drivers/rtc/rtc-pcf8583.c +++ b/drivers/rtc/rtc-pcf8583.c @@ -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: -- cgit v1.2.3