rtc: max8925: Set dev_set_drvdata before rtc_device_register
PATCH 1/1 rtc: max8925: Set dev_set_drvdata before rtc_device_register
From: Zhangfei Gao <[email protected]>
We now call rtc_read_alarm from rtc_device_register, so it
is important that the rtc device is fully initialized prior to reigstration.
Because of this, With rtc-max8925, we see NULL pointer errors, so call dev_set_drvdata before rtc_device_register
Thomas: This should go in for 2.6.39.
CC Alessandro Zummo <[email protected]>
CC Thomas Gleixner <[email protected]>
Signed-off-by Zhangfei Gao <[email protected]>
[Reworded commit message -jstultz]
Signed-off-by John Stultz <[email protected]>
--- drivers/rtc/rtc-max8925.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/rtc/rtc-max8925.c +2 -1
@@ -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 ;
Signature · 1 line
1.7.3.2.146.gca209