Skip to content
Commit fbe84bd4 authored by Crt Mori's avatar Crt Mori Committed by Jonathan Cameron
Browse files

iio: devm_regulator_get_optional never returns NULL



This patch is inspired by a comment of Jonathan Cameron on patch of
Linus Walleij commit aeb55fff ("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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarCrt Mori <cmo@melexis.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 67516074
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment