From: John Stultz <john.stultz@linaro.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Zhangfei Gao <zhangfei.gao@marvell.com>,
Alessandro Zummo <a.zummo@towertech.it>,
Thomas Gleixner <tglx@linutronix.de>,
John Stultz <john.stultz@linaro.org>
Subject: [PATCH] rtc: max8925: Set dev_set_drvdata before rtc_device_register
Date: Wed, 27 Apr 2011 11:44:29 -0700 [thread overview]
Message-ID: <1303929869-25249-1-git-send-email-john.stultz@linaro.org> (raw)
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
reply other threads:[~2011-04-27 18:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1303929869-25249-1-git-send-email-john.stultz@linaro.org \
--to=john.stultz@linaro.org \
--cc=a.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=zhangfei.gao@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®