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>
This commit is contained in:
parent
cf568c58eb
commit
9cf3b5fa6f
|
@ -220,6 +220,7 @@ static int __init coh901331_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
clk_disable(rtap->clk);
|
clk_disable(rtap->clk);
|
||||||
|
|
||||||
|
platform_set_drvdata(pdev, rtap);
|
||||||
rtap->rtc = rtc_device_register("coh901331", &pdev->dev, &coh901331_ops,
|
rtap->rtc = rtc_device_register("coh901331", &pdev->dev, &coh901331_ops,
|
||||||
THIS_MODULE);
|
THIS_MODULE);
|
||||||
if (IS_ERR(rtap->rtc)) {
|
if (IS_ERR(rtap->rtc)) {
|
||||||
|
@ -227,11 +228,10 @@ static int __init coh901331_probe(struct platform_device *pdev)
|
||||||
goto out_no_rtc;
|
goto out_no_rtc;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, rtap);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_no_rtc:
|
out_no_rtc:
|
||||||
|
platform_set_drvdata(pdev, NULL);
|
||||||
out_no_clk_enable:
|
out_no_clk_enable:
|
||||||
clk_put(rtap->clk);
|
clk_put(rtap->clk);
|
||||||
out_no_clk:
|
out_no_clk:
|
||||||
|
|
Loading…
Reference in a new issue