summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-04-17 20:32:19 +0200
committerLinus Walleij <linus.walleij@linaro.org>2011-04-20 18:46:56 +0200
commit9cf3b5fa6f7b246784d62a2a7637a871290c9ab9 (patch)
treee11c99e1af553d14619feba4f40d163df95fa09a /drivers/rtc
parentcf568c58eb192368f5e796df935704535b54f451 (diff)
downloadlinux-9cf3b5fa6f7b246784d62a2a7637a871290c9ab9.tar.bz2
rtc: fix coh901331 startup crash
The rtc_device_register() call has changed semantics so that it will immediately call out to rtc_read_alarm() and since the callbacks require the drvdata to be set, we need to set it before the registration call to avoid NULL dereference. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-coh901331.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
index 316f484999b5..80f9c88214c5 100644
--- a/drivers/rtc/rtc-coh901331.c
+++ b/drivers/rtc/rtc-coh901331.c
@@ -220,6 +220,7 @@ static int __init coh901331_probe(struct platform_device *pdev)
}
clk_disable(rtap->clk);
+ platform_set_drvdata(pdev, rtap);
rtap->rtc = rtc_device_register("coh901331", &pdev->dev, &coh901331_ops,
THIS_MODULE);
if (IS_ERR(rtap->rtc)) {
@@ -227,11 +228,10 @@ static int __init coh901331_probe(struct platform_device *pdev)
goto out_no_rtc;
}
- platform_set_drvdata(pdev, rtap);
-
return 0;
out_no_rtc:
+ platform_set_drvdata(pdev, NULL);
out_no_clk_enable:
clk_put(rtap->clk);
out_no_clk: