drivers/rtc: Skip clock_synchronize if settime return positive value

so driver implementer could call clock_synchronize by self

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-11-19 23:36:27 +08:00 committed by Petro Karashchenko
parent e6ebcb62b1
commit 67bff06a24

View File

@ -396,7 +396,7 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
if (ops->settime)
{
ret = ops->settime(upper->lower, rtctime);
if (ret >= 0)
if (ret == 0)
{
/* If the RTC time was set successfully, then update the
* current system time to match.