projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8dad69
)
rtc: max8925: Call dev_set_drvdata before rtc_device_register
author
Zhangfei Gao
<
[email protected]
>
Wed, 27 Apr 2011 18:44:29 +0000
(11:44 -0700)
committer
Thomas Gleixner
<
[email protected]
>
Thu, 28 Apr 2011 09:16:21 +0000
(11:16 +0200)
We call rtc_read_alarm from rtc_device_register, so it is important
that the rtc device is fully initialized prior to registration.
rtc-max8925 sets drvdata after register, so the rtc_read_alarm code
dereferences a NULL pointer.
Call dev_set_drvdata before rtc_device_register.
[ jstultz/tglx: Massaged commit message ]
Signed-off-by: Zhangfei Gao <
[email protected]
>
Cc: Alessandro Zummo <
[email protected]
>
Link:
http://lkml.kernel.org/r/%3C1303929869-25249-1-git-send-email-john.stultz%40linaro.org%3E
Signed-off-by: John Stultz <
[email protected]
>
Signed-off-by: Thomas Gleixner <
[email protected]
>
drivers/rtc/rtc-max8925.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rtc-max8925.c
b/drivers/rtc/rtc-max8925.c
index 174036dda78652ce106afc23d12699f1d310000b..20494b5edc3c74cc787df17a0d25f554bcf37370 100644
(file)
--- a/
drivers/rtc/rtc-max8925.c
+++ b/
drivers/rtc/rtc-max8925.c
@@
-257,6
+257,8
@@
static int __devinit max8925_rtc_probe(struct platform_device *pdev)
goto out_irq;
}
+ dev_set_drvdata(&pdev->dev, info);
+
info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev,
&max8925_rtc_ops, THIS_MODULE);
ret = PTR_ERR(info->rtc_dev);
@@
-265,7
+267,6
@@
static int __devinit max8925_rtc_probe(struct platform_device *pdev)
goto out_rtc;
}
- dev_set_drvdata(&pdev->dev, info);
platform_set_drvdata(pdev, info);
return 0;