[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1288686807.19912.2.camel@mola>
Date: Tue, 02 Nov 2010 16:33:27 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Alessandro Zummo <a.zummo@...ertech.it>,
rtc-linux@...glegroups.com,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] 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.
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists