aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-01-12 20:00:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:12 -0500
commit5f003feba2a8761d2ee7b367df5a0fe6b729dc8f (patch)
tree047b9d1785b944039454cc0d805bd6f6940787a6 /drivers
parent81d350e013a9a4b743281e16d5fd29cd8955a746 (diff)
rtc: rtc-max6902 - set driver data in max6902_probe()
Current implementation does not set driver data in max6902_probe(), thus calling platform_get_drvdata(spi) in max6902_remove() returns NULL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-max6902.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c
index 657403ebd54a..0ec3f588a255 100644
--- a/drivers/rtc/rtc-max6902.c
+++ b/drivers/rtc/rtc-max6902.c
@@ -139,12 +139,13 @@ static int __devinit max6902_probe(struct spi_device *spi)
139 if (IS_ERR(rtc)) 139 if (IS_ERR(rtc))
140 return PTR_ERR(rtc); 140 return PTR_ERR(rtc);
141 141
142 dev_set_drvdata(&spi->dev, rtc);
142 return 0; 143 return 0;
143} 144}
144 145
145static int __devexit max6902_remove(struct spi_device *spi) 146static int __devexit max6902_remove(struct spi_device *spi)
146{ 147{
147 struct rtc_device *rtc = platform_get_drvdata(spi); 148 struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
148 149
149 rtc_device_unregister(rtc); 150 rtc_device_unregister(rtc);
150 return 0; 151 return 0;