aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/interface.c8
-rw-r--r--drivers/rtc/rtc-mrst.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 6d4012dd6922..bac1eeb3d312 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -265,8 +265,10 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
265 return err; 265 return err;
266 266
267 /* full-function RTCs won't have such missing fields */ 267 /* full-function RTCs won't have such missing fields */
268 if (rtc_valid_tm(&alarm->time) == 0) 268 if (rtc_valid_tm(&alarm->time) == 0) {
269 rtc_add_offset(rtc, &alarm->time);
269 return 0; 270 return 0;
271 }
270 272
271 /* get the "after" timestamp, to detect wrapped fields */ 273 /* get the "after" timestamp, to detect wrapped fields */
272 err = rtc_read_time(rtc, &now); 274 err = rtc_read_time(rtc, &now);
@@ -409,7 +411,6 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
409 if (err) 411 if (err)
410 return err; 412 return err;
411 413
412 rtc_subtract_offset(rtc, &alarm->time);
413 scheduled = rtc_tm_to_time64(&alarm->time); 414 scheduled = rtc_tm_to_time64(&alarm->time);
414 415
415 /* Make sure we're not setting alarms in the past */ 416 /* Make sure we're not setting alarms in the past */
@@ -426,6 +427,8 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
426 * over right here, before we set the alarm. 427 * over right here, before we set the alarm.
427 */ 428 */
428 429
430 rtc_subtract_offset(rtc, &alarm->time);
431
429 if (!rtc->ops) 432 if (!rtc->ops)
430 err = -ENODEV; 433 err = -ENODEV;
431 else if (!rtc->ops->set_alarm) 434 else if (!rtc->ops->set_alarm)
@@ -467,7 +470,6 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
467 470
468 mutex_unlock(&rtc->ops_lock); 471 mutex_unlock(&rtc->ops_lock);
469 472
470 rtc_add_offset(rtc, &alarm->time);
471 return err; 473 return err;
472} 474}
473EXPORT_SYMBOL_GPL(rtc_set_alarm); 475EXPORT_SYMBOL_GPL(rtc_set_alarm);
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index 097a4d4e2aba..1925aaf09093 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -367,10 +367,8 @@ static int vrtc_mrst_do_probe(struct device *dev, struct resource *iomem,
367 } 367 }
368 368
369 retval = rtc_register_device(mrst_rtc.rtc); 369 retval = rtc_register_device(mrst_rtc.rtc);
370 if (retval) { 370 if (retval)
371 retval = PTR_ERR(mrst_rtc.rtc);
372 goto cleanup0; 371 goto cleanup0;
373 }
374 372
375 dev_dbg(dev, "initialised\n"); 373 dev_dbg(dev, "initialised\n");
376 return 0; 374 return 0;