projects/linux·commit eba93fcc

drivers/rtc/rtc-ab3100.c: add missing platform_set_drvdata() in ab3100_rtc_probe()

eba93fcc · Axel Lin <[email protected]> · 2010-09-22 13:04:59 -07:00

Otherwise, calling platform_get_drvdata() in ab3100_rtc_remove() returns
NULL.

Signed-off-by: Axel Lin <[email protected]>
Acked-by:Wan ZongShun <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
eba93fcc34d6c4387ce8fbb53bb7b685f91f3343
Parents
f5665518

Changes

1 files changed · +2 −0

FileStatusAddDelContent
drivers/rtc/rtc-ab3100.cmodified+2−0View file

drivers/rtc/rtc-ab3100.c

View file
diff --git a/drivers/rtc/rtc-ab3100.c b/drivers/rtc/rtc-ab3100.c
index d26780e..261a07e 100644
--- a/drivers/rtc/rtc-ab3100.c
+++ b/drivers/rtc/rtc-ab3100.c
@@ -235,6 +235,7 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev)
err = PTR_ERR(rtc);
return err;
}
+ platform_set_drvdata(pdev, rtc);
return 0;
}
@@ -244,6 +245,7 @@ static int __exit ab3100_rtc_remove(struct platform_device *pdev)
struct rtc_device *rtc = platform_get_drvdata(pdev);
rtc_device_unregister(rtc);
+ platform_set_drvdata(pdev, NULL);
return 0;
}