RTC fixes for 4.18
- an important core fix for RTCs using the core offsetting only one driver is affected. - a fix for the error path of mrst -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEXx9Viay1+e7J/aM4AyWl4gNJNJIFAltKYQYACgkQAyWl4gNJ NJIKGhAArX+cn/MjFGYczb31UbGKsGIasPH86sze1vZ56gA/lq8mKGO+N5ftQ9ex BjRa6ohT6kp7dmRsuYwkjRDuMw6syb1TDXlxWRP+aH9iFrWlD/mu59X9EN3TsFHP 0/DDbZNQf7RE8Qd9FYgmo5dOqt9VSLw7C8Tb2xcblZX44ee1fcnuwsqxcyivUJTQ Q/HWkf09IUzOfhkVXPhyOTD/NX8qT64V1jSaW4S3ZJZAlRDCxIvZmDP3FWDsHdfy r/0dLbUE8hy3QtXOzeknjsxGaqsCPiVwKveVVBxxjCiT9/uUe6rqHT/eZ0JAqbKE MybxtqqCV+KrAR3nVdN4dNan18hCwhPUaJEZ/WkCENQlvkQ+VDPQPWTAOGZENrZn UE6ZbGeoN0Ysg1aN0RaavKDsSdh1QgkNgfsVW3gbUHuG99N0N5IR1z3OKGo1XB9U FyVOs3+3AtCkdyRrF1OOjn03lm0jrDbTbQCpyjKTXWWWeCKu/d7pXSSSD7KrT3AD ltyamhL1avudHpsQxoDpC/UNXagkLaZ3BbZxvKDB3rpjp9u0IYIslPiHRKMfITG1 IMTbPGLdQdfC4OxQ+0U4CCrobJaRU1on/z2CRGjTAzatXhUUkDacWe8XEpArwASR yWfNMZ3GGWYMqLOzD+TX6tD3KqnolQVAROFYbbQwT+D4PGqQxFg= =h23M -----END PGP SIGNATURE----- Merge tag 'rtc-4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC fixes from Alexandre Belloni: "Two fixes for 4.18: - an important core fix for RTCs using the core offsetting only one driver is affected - a fix for the error path of mrst" * tag 'rtc-4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: fix alarm read and set offset rtc: mrst: fix error code in probe()
This commit is contained in:
commit
37b5dca289
@ -265,8 +265,10 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
/* full-function RTCs won't have such missing fields */
|
/* full-function RTCs won't have such missing fields */
|
||||||
if (rtc_valid_tm(&alarm->time) == 0)
|
if (rtc_valid_tm(&alarm->time) == 0) {
|
||||||
|
rtc_add_offset(rtc, &alarm->time);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* get the "after" timestamp, to detect wrapped fields */
|
/* get the "after" timestamp, to detect wrapped fields */
|
||||||
err = rtc_read_time(rtc, &now);
|
err = rtc_read_time(rtc, &now);
|
||||||
@ -409,7 +411,6 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
rtc_subtract_offset(rtc, &alarm->time);
|
|
||||||
scheduled = rtc_tm_to_time64(&alarm->time);
|
scheduled = rtc_tm_to_time64(&alarm->time);
|
||||||
|
|
||||||
/* Make sure we're not setting alarms in the past */
|
/* 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)
|
|||||||
* over right here, before we set the alarm.
|
* over right here, before we set the alarm.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
rtc_subtract_offset(rtc, &alarm->time);
|
||||||
|
|
||||||
if (!rtc->ops)
|
if (!rtc->ops)
|
||||||
err = -ENODEV;
|
err = -ENODEV;
|
||||||
else if (!rtc->ops->set_alarm)
|
else if (!rtc->ops->set_alarm)
|
||||||
@ -467,7 +470,6 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
|
|||||||
|
|
||||||
mutex_unlock(&rtc->ops_lock);
|
mutex_unlock(&rtc->ops_lock);
|
||||||
|
|
||||||
rtc_add_offset(rtc, &alarm->time);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rtc_set_alarm);
|
EXPORT_SYMBOL_GPL(rtc_set_alarm);
|
||||||
|
@ -367,10 +367,8 @@ static int vrtc_mrst_do_probe(struct device *dev, struct resource *iomem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
retval = rtc_register_device(mrst_rtc.rtc);
|
retval = rtc_register_device(mrst_rtc.rtc);
|
||||||
if (retval) {
|
if (retval)
|
||||||
retval = PTR_ERR(mrst_rtc.rtc);
|
|
||||||
goto cleanup0;
|
goto cleanup0;
|
||||||
}
|
|
||||||
|
|
||||||
dev_dbg(dev, "initialised\n");
|
dev_dbg(dev, "initialised\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user