Skip to content

Commit

Permalink
rtc: rtc-max6902 - set driver data in max6902_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AxelLin authored and torvalds committed Jan 13, 2011
1 parent 81d350e commit 5f003fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-max6902.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f003fe

Please sign in to comment.