]> git.baikalelectronics.ru Git - kernel.git/commit
iio: devm_regulator_get_optional never returns NULL
authorCrt Mori <cmo@melexis.com>
Mon, 5 Sep 2016 09:14:49 +0000 (11:14 +0200)
committerJonathan Cameron <jic23@kernel.org>
Mon, 5 Sep 2016 20:09:38 +0000 (21:09 +0100)
commit5fb39c5b8b0c649338389f49b5e3fae9f4fcf4d0
tree0a486f49e18cee511fe61da8c1f1ce9833b19e01
parent8122de9fcddd4cf4349a7dbbb9d7e042cc3bbab0
iio: devm_regulator_get_optional never returns NULL

This patch is inspired by a comment of Jonathan Cameron on patch of
Linus Walleij commit 22b98de055b502baecf345d5ea94f2694a5978c1 ("iio:
st_sensors: fetch and enable regulators unconditionally"). Because
changes made in this patch are actually reference generators they should
be using devm_regulator_get_optional, but if they do not explicitly set
the reference to NULL they should not be using IS_ERR_OR_NULL, but
simple IS_ERR check.

Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/ad7266.c
drivers/iio/adc/ti-ads8688.c