summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-10-09 09:02:54 (GMT)
committerMark Brown <broonie@kernel.org>2014-10-13 10:47:54 (GMT)
commit439e8211a78ad31615c76b18e4f13eb900c89758 (patch)
treec20399c46d9ce4bd2a3834cbc74da57ca001b41d /drivers
parentf5b313a2bcd4c436560c044c726d9ad84a3e4bb3 (diff)
downloadlinux-439e8211a78ad31615c76b18e4f13eb900c89758.tar.xz
regmap: cache: fix errno in regcache_hw_init()
When kmalloc() fails, we should return -ENOMEM. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/regmap/regcache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index f1280dc..44e6a48 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -44,7 +44,7 @@ static int regcache_hw_init(struct regmap *map)
map->cache_bypass = 1;
tmp_buf = kmalloc(map->cache_size_raw, GFP_KERNEL);
if (!tmp_buf)
- return -EINVAL;
+ return -ENOMEM;
ret = regmap_raw_read(map, 0, tmp_buf,
map->num_reg_defaults_raw);
map->cache_bypass = cache_bypass;