From: Axel Lin Date: Thu, 13 Jan 2011 01:00:09 +0000 (-0800) Subject: rtc: rtc-max6902 - set driver data in max6902_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f003feba2a8761d2ee7b367df5a0fe6b729dc8f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) 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;