]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtc: cmos: Fix return value of nvmem callbacks
authorJoy Chakraborty <joychakr@google.com>
Wed, 12 Jun 2024 08:36:35 +0000 (08:36 +0000)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 27 Jun 2024 22:21:06 +0000 (00:21 +0200)
commit1c184baccf0d5e2ef4cc1562261d0e48508a1c2b
tree6cc680f610565f085f5a8cddde221ffd3fdb01f6
parent70f1ae5f0e7f44edf842444044615da7b59838c1
rtc: cmos: Fix return value of nvmem callbacks

Read/write callbacks registered with nvmem core expect 0 to be returned
on success and a negative value to be returned on failure.

cmos_nvram_read()/cmos_nvram_write() currently return the number of
bytes read or written, fix to return 0 on success and -EIO incase number
of bytes requested was not read or written.

Fixes: 8b5b7958fd1c ("rtc: cmos: use generic nvmem")
Cc: stable@vger.kernel.org
Signed-off-by: Joy Chakraborty <joychakr@google.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240612083635.1253039-1-joychakr@google.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-cmos.c