projects/linux·commit 5f003feb

rtc: rtc-max6902 - set driver data in max6902_probe()

5f003feb · Axel Lin <[email protected]> · 2011-01-12 17:00:09 -08:00

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 <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
5f003feba2a8761d2ee7b367df5a0fe6b729dc8f
Parents
81d350e0

Changes

1 files changed · +2 −1

FileStatusAddDelContent
drivers/rtc/rtc-max6902.cmodified+2−1View file

drivers/rtc/rtc-max6902.c

View file
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c
index 657403e..0ec3f58 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)
if (IS_ERR(rtc))
return PTR_ERR(rtc);
+ dev_set_drvdata(&spi->dev, rtc);
return 0;
}
static int __devexit max6902_remove(struct spi_device *spi)
{
- struct rtc_device *rtc = platform_get_drvdata(spi);
+ struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
rtc_device_unregister(rtc);
return 0;