Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Linus Torvalds
5f003feb 81d350e0

+2 -1
+2 -1
drivers/rtc/rtc-max6902.c
··· 139 139 if (IS_ERR(rtc)) 140 140 return PTR_ERR(rtc); 141 141 142 + dev_set_drvdata(&spi->dev, rtc); 142 143 return 0; 143 144 } 144 145 145 146 static 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 150 rtc_device_unregister(rtc); 150 151 return 0;