All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: max8925: Set dev_set_drvdata before rtc_device_register
@ 2011-04-27 18:44 John Stultz
  0 siblings, 0 replies; only message in thread
From: John Stultz @ 2011-04-27 18:44 UTC (permalink / raw)
  To: LKML; +Cc: Zhangfei Gao, Alessandro Zummo, Thomas Gleixner, John Stultz

From: Zhangfei Gao <zhangfei.gao@marvell.com>

	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 <a.zummo@towertech.it>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Zhangfei Gao <zhangfei.gao@marvell.com>
[Reworded commit message -jstultz]
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 drivers/rtc/rtc-max8925.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c
index 174036d..20494b5 100644
--- 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;
-- 
1.7.3.2.146.gca209


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-27 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27 18:44 [PATCH] rtc: max8925: Set dev_set_drvdata before rtc_device_register John Stultz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.