]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nvmem: meson-efuse: Fix return value of nvmem callbacks
authorJoy Chakraborty <joychakr@google.com>
Fri, 28 Jun 2024 11:37:02 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2024 14:37:51 +0000 (16:37 +0200)
commit7a0a6d0a7c805f9380381f4deedffdf87b93f408
treeca925c5d045ba68b9889b9fa791370f7bcbe9e55
parent28b008751aa295612318a0fbb2f22dd4f6a83139
nvmem: meson-efuse: 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.

meson_efuse_read() and meson_efuse_write() call into
meson_sm_call_read() and meson_sm_call_write() respectively which return
the number of bytes read or written on success as per their api
description.

Fix to return error if meson_sm_call_read()/meson_sm_call_write()
returns an error else return 0.

Fixes: a29a63bdaf6f ("nvmem: meson-efuse: simplify read callback")
Cc: stable@vger.kernel.org
Signed-off-by: Joy Chakraborty <joychakr@google.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240628113704.13742-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/meson-efuse.c