diff options
| author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-03-10 00:35:08 -0500 |
|---|---|---|
| committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-03-27 04:45:03 -0400 |
| commit | 88c998743105806f6564ccb660b5b993dba0e741 (patch) | |
| tree | 2c5e9a90926594e1259bccbbe6895c1a591006b1 /drivers/rtc | |
| parent | f441f98f5834a7f9734f6b183b5580f510344a87 (diff) | |
rtc: st-lpc: remove artificial limitation
The LPC RTC supports dates way beyond 2038, don't limit it artificially as
the kernel handles dates after 2038 properly.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | drivers/rtc/rtc-st-lpc.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index 82b0af159a28..d5222667f892 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c | |||
| @@ -195,7 +195,6 @@ static int st_rtc_probe(struct platform_device *pdev) | |||
| 195 | struct device_node *np = pdev->dev.of_node; | 195 | struct device_node *np = pdev->dev.of_node; |
| 196 | struct st_rtc *rtc; | 196 | struct st_rtc *rtc; |
| 197 | struct resource *res; | 197 | struct resource *res; |
| 198 | struct rtc_time tm_check; | ||
| 199 | uint32_t mode; | 198 | uint32_t mode; |
| 200 | int ret = 0; | 199 | int ret = 0; |
| 201 | 200 | ||
| @@ -254,21 +253,6 @@ static int st_rtc_probe(struct platform_device *pdev) | |||
| 254 | 253 | ||
| 255 | platform_set_drvdata(pdev, rtc); | 254 | platform_set_drvdata(pdev, rtc); |
| 256 | 255 | ||
| 257 | /* | ||
| 258 | * The RTC-LPC is able to manage date.year > 2038 | ||
| 259 | * but currently the kernel can not manage this date! | ||
| 260 | * If the RTC-LPC has a date.year > 2038 then | ||
| 261 | * it's set to the epoch "Jan 1st 2000" | ||
| 262 | */ | ||
| 263 | st_rtc_read_time(&pdev->dev, &tm_check); | ||
| 264 | |||
| 265 | if (tm_check.tm_year >= (2038 - 1900)) { | ||
| 266 | memset(&tm_check, 0, sizeof(tm_check)); | ||
| 267 | tm_check.tm_year = 100; | ||
| 268 | tm_check.tm_mday = 1; | ||
| 269 | st_rtc_set_time(&pdev->dev, &tm_check); | ||
| 270 | } | ||
| 271 | |||
| 272 | rtc->rtc_dev = rtc_device_register("st-lpc-rtc", &pdev->dev, | 256 | rtc->rtc_dev = rtc_device_register("st-lpc-rtc", &pdev->dev, |
| 273 | &st_rtc_ops, THIS_MODULE); | 257 | &st_rtc_ops, THIS_MODULE); |
| 274 | if (IS_ERR(rtc->rtc_dev)) { | 258 | if (IS_ERR(rtc->rtc_dev)) { |
