* [PATCH] rtc: rtc-max6902 - set driver data in max6902_probe()
@ 2010-11-02 8:33 Axel Lin
0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2010-11-02 8:33 UTC (permalink / raw)
To: linux-kernel; +Cc: Alessandro Zummo, rtc-linux, Andrew Morton
Current implementation does not set driver data in max6902_probe(),
thus calling platform_get_drvdata(spi) in max6902_remove() returns NULL.
Since this is a spi driver, use spi_set_drvdata/spi_get_drvdata to
set/get driver data.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/rtc/rtc-max6902.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c
index 657403e..23faecb 100644
--- a/drivers/rtc/rtc-max6902.c
+++ b/drivers/rtc/rtc-max6902.c
@@ -138,15 +138,17 @@ static int __devinit max6902_probe(struct spi_device *spi)
&spi->dev, &max6902_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
+ spi_set_drvdata(spi, rtc);
return 0;
}
static int __devexit max6902_remove(struct spi_device *spi)
{
- struct rtc_device *rtc = platform_get_drvdata(spi);
+ struct rtc_device *rtc = spi_get_drvdata(spi);
rtc_device_unregister(rtc);
+ spi_set_drvdata(spi, NULL);
return 0;
}
--
1.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] rtc: rtc-max6902 - set driver data in max6902_probe()
@ 2011-01-12 7:36 Axel Lin
0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2011-01-12 7:36 UTC (permalink / raw)
To: linux-kernel; +Cc: Alessandro Zummo, Andrew Morton, rtc-linux
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>
---
drivers/rtc/rtc-max6902.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
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;
--
1.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-12 7:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 7:36 [PATCH] rtc: rtc-max6902 - set driver data in max6902_probe() Axel Lin
-- strict thread matches above, loose matches on Subject: below --
2010-11-02 8:33 Axel Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox