regmap: cache: Move the num_reg_defaults check as early as possible
authorXiubo Li <lixiubo@cmss.chinamobile.com>
Fri, 11 Dec 2015 03:23:20 +0000 (11:23 +0800)
committerMark Brown <broonie@kernel.org>
Sat, 12 Dec 2015 22:37:06 +0000 (22:37 +0000)
commit167f7066a637332b463adf3b87b2af1c1031591a
tree64037f281d013f9bc362d82c432c0a5bc0aca25e
parent8cfe2fd3562ba673435bb2d7a4bb451aabd47809
regmap: cache: Move the num_reg_defaults check as early as possible

If the register defaults are provided by the driver without the
number by mistake, it should just return an error with one promotion.

This should be as early as possible, then there is no need to verify
the register defaults' stride and the other code followed.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regcache.c