aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-05 18:37:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-05 18:37:40 -0400
commitcbda94e039c3862326a65d1d0506447af8330c3c (patch)
tree1147da54ec6eb7e1081977f07e62d514b981d9a3 /drivers/rtc
parentf83ccb93585d1f472c30fa2bbb8b56c23dbdb506 (diff)
parentf1d7d8c86bc8ca41c88acf10ce383c5104cf4920 (diff)
Merge tag 'drivers-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver changes from Arnd Bergmann: "These changes are mostly for ARM specific device drivers that either don't have an upstream maintainer, or that had the maintainer ask us to pick up the changes to avoid conflicts. A large chunk of this are clock drivers (bcm281xx, exynos, versatile, shmobile), aside from that, reset controllers for STi as well as a large rework of the Marvell Orion/EBU watchdog driver are notable" * tag 'drivers-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (99 commits) Revert "dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac." Revert "net: stmmac: Add SOCFPGA glue driver" ARM: shmobile: r8a7791: Fix SCIFA3-5 clocks ARM: STi: Add reset controller support to mach-sti Kconfig drivers: reset: stih416: add softreset controller drivers: reset: stih415: add softreset controller drivers: reset: Reset controller driver for STiH416 drivers: reset: Reset controller driver for STiH415 drivers: reset: STi SoC system configuration reset controller support dts: socfpga: Add sysmgr node so the gmac can use to reference dts: socfpga: Add support for SD/MMC on the SOCFPGA platform reset: Add optional resets and stubs ARM: shmobile: r7s72100: fix bus clock calculation Power: Reset: Generalize qnap-poweroff to work on Synology devices. dts: socfpga: Update clock entry to support multiple parents ARM: socfpga: Update socfpga_defconfig dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac. net: stmmac: Add SOCFPGA glue driver watchdog: orion_wdt: Use %pa to print 'phys_addr_t' drivers: cci: Export CCI PMU revision ...
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-isl12057.c5
-rw-r--r--drivers/rtc/rtc-mv.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-isl12057.c b/drivers/rtc/rtc-isl12057.c
index 7e5ead936a04..41bd76aaff76 100644
--- a/drivers/rtc/rtc-isl12057.c
+++ b/drivers/rtc/rtc-isl12057.c
@@ -274,10 +274,7 @@ static int isl12057_probe(struct i2c_client *client,
274 dev_set_drvdata(dev, data); 274 dev_set_drvdata(dev, data);
275 275
276 rtc = devm_rtc_device_register(dev, DRV_NAME, &rtc_ops, THIS_MODULE); 276 rtc = devm_rtc_device_register(dev, DRV_NAME, &rtc_ops, THIS_MODULE);
277 if (IS_ERR(rtc)) 277 return PTR_ERR_OR_ZERO(rtc);
278 return PTR_ERR(rtc);
279
280 return 0;
281} 278}
282 279
283#ifdef CONFIG_OF 280#ifdef CONFIG_OF
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index d536c5962c99..d15a999363fc 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -222,6 +222,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
222 struct resource *res; 222 struct resource *res;
223 struct rtc_plat_data *pdata; 223 struct rtc_plat_data *pdata;
224 u32 rtc_time; 224 u32 rtc_time;
225 u32 rtc_date;
225 int ret = 0; 226 int ret = 0;
226 227
227 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 228 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
@@ -257,6 +258,17 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
257 } 258 }
258 } 259 }
259 260
261 /*
262 * A date after January 19th, 2038 does not fit on 32 bits and
263 * will confuse the kernel and userspace. Reset to a sane date
264 * (January 1st, 2013) if we're after 2038.
265 */
266 rtc_date = readl(pdata->ioaddr + RTC_DATE_REG_OFFS);
267 if (bcd2bin((rtc_date >> RTC_YEAR_OFFS) & 0xff) >= 38) {
268 dev_info(&pdev->dev, "invalid RTC date, resetting to January 1st, 2013\n");
269 writel(0x130101, pdata->ioaddr + RTC_DATE_REG_OFFS);
270 }
271
260 pdata->irq = platform_get_irq(pdev, 0); 272 pdata->irq = platform_get_irq(pdev, 0);
261 273
262 platform_set_drvdata(pdev, pdata); 274 platform_set_drvdata(pdev, pdata);