]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 4 Feb 2017 18:19:21 +0000 (10:19 -0800)
committerMark Brown <broonie@kernel.org>
Sun, 5 Feb 2017 16:36:40 +0000 (17:36 +0100)
commitd193ac5ca783da9d1f427ebe9d2d09a5c2f905a6
tree5211e13ebc37a571cc0f8631bbba99624a5c2653
parent5e37f13f8d15eee7d129af5d4b318f5fd611e32b
regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors

Instead of returning both regulator_dev structure as return value and
auxiliary error code in 'ret' argument, let's switch to using ERR_PTR
encoded values. This makes it more obvious what is going on at call sites.

Also, let's not unlock the mutex in the middle of a loop, but rather break
out and have single unlock path.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c