regmap: return ERR_PTR instead of NULL in regmap_init
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 14 Nov 2011 09:40:15 +0000 (10:40 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 14 Nov 2011 21:44:45 +0000 (21:44 +0000)
commitabbb18fb4ad7472ee2e1351f0ca12bce64cac143
tree6d978b25cf53daefb0003cd54d4f98bbc3e0c292
parent58072cbfc522c2520e34333a53c8f17bb1adb1a0
regmap: return ERR_PTR instead of NULL in regmap_init

The regmap_init documentation states that it will either return a pointer to a
valid regmap structure or a ERR_PTR in case of an error. Currently it returns a
NULL pointer in case no bus or no config was given. Since NULL is not a
ERR_PTR a caller might assume that it is a pointer to a valid regmap structure,
so return a ERR_PTR(-EINVAL) instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap.c
This page took 0.025163 seconds and 5 git commands to generate.