diff options
author | Dan Willemsen <dwillemsen@nvidia.com> | 2011-05-19 10:21:54 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:43:14 -0800 |
commit | 46795f91286bdedc0f372e654080a4d1bef88b27 (patch) | |
tree | a5c4af07c5a20c982e9d26db9045078714ad18e3 | |
parent | 552716d653b7c18b1aa45d8d8af127b46f585451 (diff) |
rtc: fix tps6586x startup crash
The rtc_device_register() call has changed semantics so that it will
immediately call out to rtc_read_alarm() and since the callbacks require
the drvdata to be set, we need to set it before the registration call to
vaoid NULL dereference.
Based on 9cf3b5fa6f7b246784d62a2a7637a871290c9ab9
Rebase-Id: R641c71563fd9b41a92b2d6679c04edf94ed36e25
-rw-r--r-- | drivers/rtc/rtc-tps6586x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c index 265c57d55ed1..729d71ecc754 100644 --- a/drivers/rtc/rtc-tps6586x.c +++ b/drivers/rtc/rtc-tps6586x.c @@ -282,6 +282,7 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) rtc->epoch_start = mktime(epoch->year, epoch->month, epoch->day, epoch->hour, epoch->min, epoch->sec); + dev_set_drvdata(&pdev->dev, rtc); rtc->rtc = rtc_device_register("tps6586x-rtc", &pdev->dev, &tps6586x_rtc_ops, THIS_MODULE); @@ -300,7 +301,6 @@ static int __devinit tps6586x_rtc_probe(struct platform_device *pdev) goto fail; } - dev_set_drvdata(&pdev->dev, rtc); if (pdata && (pdata->irq >= 0)) { rtc->irq = pdata->irq; err = request_threaded_irq(pdata->irq, NULL, tps6586x_rtc_irq, |