Commit 244cf8f0 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: pcf8523: return meaningful value for RTC_VL_READ

REG_CONTROL3_BLF indicates the battery is low and needs to be replaced
soon.

Link: https://lore.kernel.org/r/20191214220259.621996-6-alexandre.belloni@bootlin.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent af427311
......@@ -282,11 +282,11 @@ static int pcf8523_rtc_ioctl(struct device *dev, unsigned int cmd,
ret = pcf8523_voltage_low(client);
if (ret < 0)
return ret;
if (ret)
ret = RTC_VL_BACKUP_LOW;
if (copy_to_user((void __user *)arg, &ret, sizeof(int)))
return -EFAULT;
return put_user(ret, (unsigned int __user *)arg);
return 0;
default:
return -ENOIOCTLCMD;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment