summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-10-09 17:02:54 +0800
committerMark Brown <broonie@kernel.org>2014-10-20 12:25:01 +0100
commitba3f1c85a6e05e0ff90215d817249617fcbee523 (patch)
tree1cf66b0fa9e2f23b83e66a3571ee6ef1ee8ecfe1 /drivers/base
parent5bd83ed0984b0b0ac51d648b0ec167b36291f87e (diff)
downloadtalos-obmc-linux-ba3f1c85a6e05e0ff90215d817249617fcbee523.tar.gz
talos-obmc-linux-ba3f1c85a6e05e0ff90215d817249617fcbee523.zip
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/base')
-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 7558e6b01c04..6bec659e35d9 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;
OpenPOWER on IntegriCloud