summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem/rmem.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--drivers/nvmem/rmem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/nvmem/rmem.c b/drivers/nvmem/rmem.c
index 752d0bf444..7f907c5a44 100644
--- a/drivers/nvmem/rmem.c
+++ b/drivers/nvmem/rmem.c
@@ -46,7 +46,10 @@ static int rmem_read(void *context, unsigned int offset,
memunmap(addr);
- return count;
+ if (count < 0)
+ return count;
+
+ return count == bytes ? 0 : -EIO;
}
static int rmem_probe(struct platform_device *pdev)