[PATCH 2/2] regmap: cache: Fix return value

From: Alexander Stein
Date: Fri Mar 10 2023 - 02:40:15 EST


checkpatch.pl warned:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else
Align the return value to regcache_drop_region().

Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
---
This warning popped up while initially returning ENOSYS in patch 1.

But I'm wondering if returning 0 for regcache_write is correct or not.
This might be a follow-up patch though.

drivers/base/regmap/regcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index b61763dbfc68..c13f5f8872ac 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -242,7 +242,7 @@ int regcache_read(struct regmap *map,
int ret;

if (map->cache_type == REGCACHE_NONE)
- return -ENOSYS;
+ return -EINVAL;

BUG_ON(!map->cache_ops);

--
2.34.1