linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: prakity@marvell.com (Philip Rakity)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] rtc: max8925 crash since driver data not set before interr=
Date: Mon, 18 Apr 2011 12:56:17 -0700	[thread overview]
Message-ID: <mailman.202.1303156790.1530.linux-arm-kernel@lists.infradead.org> (raw)

upt

in probe set the platform data before setting up interrupts
avoids crash at start-up time.

Signed-off-by: Philip Rakity <prakity@marvell.com>
---
 drivers/rtc/rtc-max8925.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-max8925.c b/drivers/rtc/rtc-max8925.c
index 174036d..24a326a 100644
--- a/drivers/rtc/rtc-max8925.c
+++ b/drivers/rtc/rtc-max8925.c
@@ -249,6 +249,9 @@ static int __devinit max8925_rtc_probe(struct platform_=
device *pdev)
 	info->dev =3D &pdev->dev;
 	irq =3D chip->irq_base + MAX8925_IRQ_RTC_ALARM0;
=20
+	dev_set_drvdata(&pdev->dev, info);
+	platform_set_drvdata(pdev, info);
+
 	ret =3D request_threaded_irq(irq, NULL, rtc_update_handler,
 				   IRQF_ONESHOT, "rtc-alarm0", info);
 	if (ret < 0) {
@@ -265,9 +268,6 @@ static int __devinit max8925_rtc_probe(struct platform_=
device *pdev)
 		goto out_rtc;
 	}
=20
-	dev_set_drvdata(&pdev->dev, info);
-	platform_set_drvdata(pdev, info);
-
 	return 0;
 out_rtc:
 	free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info);
--=20
1.7.0.4

                 reply	other threads:[~2011-04-18 19:56 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=mailman.202.1303156790.1530.linux-arm-kernel@lists.infradead.org \
    --to=prakity@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).