diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2014-10-09 13:02:54 +0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-13 14:47:54 +0400 |
commit | 439e8211a78ad31615c76b18e4f13eb900c89758 (patch) | |
tree | c20399c46d9ce4bd2a3834cbc74da57ca001b41d /drivers/base | |
parent | f5b313a2bcd4c436560c044c726d9ad84a3e4bb3 (diff) | |
download | linux-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/base')
-rw-r--r-- | drivers/base/regmap/regcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index f1280dc356d0..44e6a48019a5 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; |