Message ID | 1645090578-20734-1-git-send-email-loic.poulain@linaro.org |
---|---|
State | Accepted |
Headers | show |
Series | rtc: pm8xxx: Return -ENODEV if set_time disallowed | expand |
On Thu, 17 Feb 2022 10:36:18 +0100, Loic Poulain wrote: > Having !allow_set_time is equivalent to non-implemented set_time > function, which is normally represented with -ENODEV error in RTC > subsystem. > > Today we are returning -EACCES error code, which is not considered > by RTC clients as a 'non implemented' feature, and which causes NTP > to retry hw clk sync (update_rtc) indefinitely. > > [...] Applied, thanks! [1/1] rtc: pm8xxx: Return -ENODEV if set_time disallowed commit: 870c54e1a3e111613cd68e5cc867455dc4765cd6
diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c index 75954dd..dc6d147 100644 --- a/drivers/rtc/rtc-pm8xxx.c +++ b/drivers/rtc/rtc-pm8xxx.c @@ -84,7 +84,7 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; if (!rtc_dd->allow_set_time) - return -EACCES; + return -ENODEV; secs = rtc_tm_to_time64(tm);
Having !allow_set_time is equivalent to non-implemented set_time function, which is normally represented with -ENODEV error in RTC subsystem. Today we are returning -EACCES error code, which is not considered by RTC clients as a 'non implemented' feature, and which causes NTP to retry hw clk sync (update_rtc) indefinitely. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> --- drivers/rtc/rtc-pm8xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)