mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
UPSTREAM: regulator: tps65132: Stop parsing DT when gpio is not found
In case of a missing (optional) gpio don't fall through up to
"ti,active-discharge-time-us" due to
devm_fwnode_get_index_gpiod_from_child() returning NULL (since
gpiod_get_from_of_node() returned NULL) but rather indicate success as
intended.
This makes the driver probe correctly when e.g. only the enable gpio is
given.
Change-Id: Ic01e5b2ab058d9b34b4ffabb22d494a608847b3d
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Link: https://lore.kernel.org/r/363bd50cc7c60daa57d614a341d1fd649f05194c.1567625660.git.agx@sigxcpu.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from a957446706)
This commit is contained in:
@@ -138,7 +138,7 @@ static int tps65132_of_parse_cb(struct device_node *np,
|
||||
|
||||
rpdata->en_gpiod = devm_fwnode_get_index_gpiod_from_child(tps->dev,
|
||||
"enable", 0, &np->fwnode, 0, "enable");
|
||||
if (IS_ERR(rpdata->en_gpiod)) {
|
||||
if (IS_ERR_OR_NULL(rpdata->en_gpiod)) {
|
||||
ret = PTR_ERR(rpdata->en_gpiod);
|
||||
|
||||
/* Ignore the error other than probe defer */
|
||||
@@ -150,7 +150,7 @@ static int tps65132_of_parse_cb(struct device_node *np,
|
||||
rpdata->act_dis_gpiod = devm_fwnode_get_index_gpiod_from_child(
|
||||
tps->dev, "active-discharge", 0,
|
||||
&np->fwnode, 0, "active-discharge");
|
||||
if (IS_ERR(rpdata->act_dis_gpiod)) {
|
||||
if (IS_ERR_OR_NULL(rpdata->act_dis_gpiod)) {
|
||||
ret = PTR_ERR(rpdata->act_dis_gpiod);
|
||||
|
||||
/* Ignore the error other than probe defer */
|
||||
|
||||
Reference in New Issue
Block a user