Commit 67c1b8c6 authored by Feng Tang's avatar Feng Tang Committed by John Stultz

RTC: rtc-mrst: follow on to the change of rtc_device_register()

commit f44f7f96 (RTC: Initialize kernel state from RTC) will
call rtc_read_alarm() inside rtc_device_register(), so rtc-mrst
driver need to call dev_set_drvdata() before rtc_device_register()
get called.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 8c122b96
...@@ -342,6 +342,8 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq) ...@@ -342,6 +342,8 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
mrst_rtc.irq = rtc_irq; mrst_rtc.irq = rtc_irq;
mrst_rtc.iomem = iomem; mrst_rtc.iomem = iomem;
mrst_rtc.dev = dev;
dev_set_drvdata(dev, &mrst_rtc);
mrst_rtc.rtc = rtc_device_register(driver_name, dev, mrst_rtc.rtc = rtc_device_register(driver_name, dev,
&mrst_rtc_ops, THIS_MODULE); &mrst_rtc_ops, THIS_MODULE);
...@@ -350,8 +352,6 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq) ...@@ -350,8 +352,6 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
goto cleanup0; goto cleanup0;
} }
mrst_rtc.dev = dev;
dev_set_drvdata(dev, &mrst_rtc);
rename_region(iomem, dev_name(&mrst_rtc.rtc->dev)); rename_region(iomem, dev_name(&mrst_rtc.rtc->dev));
spin_lock_irq(&rtc_lock); spin_lock_irq(&rtc_lock);
...@@ -376,9 +376,10 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq) ...@@ -376,9 +376,10 @@ vrtc_mrst_do_probe(struct device *dev, struct resource *iomem, int rtc_irq)
return 0; return 0;
cleanup1: cleanup1:
mrst_rtc.dev = NULL;
rtc_device_unregister(mrst_rtc.rtc); rtc_device_unregister(mrst_rtc.rtc);
cleanup0: cleanup0:
dev_set_drvdata(dev, NULL);
mrst_rtc.dev = NULL;
release_region(iomem->start, iomem->end + 1 - iomem->start); release_region(iomem->start, iomem->end + 1 - iomem->start);
dev_err(dev, "rtc-mrst: unable to initialise\n"); dev_err(dev, "rtc-mrst: unable to initialise\n");
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment