Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

regulator: tps65132: switch to using devm_fwnode_gpiod_get()

devm_fwnode_get_index_gpiod_from_child() is going away as the name is
too unwieldy, let's switch to using the new devm_fwnode_gpiod_get().

Note that we no longer need to check for NULL as devm_fwnode_gpiod_get()
will return -ENOENT if GPIO is missing.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20191004231017.130290-7-dmitry.torokhov@gmail.com
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dmitry Torokhov and committed by
Mark Brown
22803ca3 61d2fc3c

+10 -7
+10 -7
drivers/regulator/tps65132-regulator.c
··· 136 136 struct tps65132_reg_pdata *rpdata = &tps->reg_pdata[desc->id]; 137 137 int ret; 138 138 139 - rpdata->en_gpiod = devm_fwnode_get_index_gpiod_from_child(tps->dev, 140 - "enable", 0, &np->fwnode, 0, "enable"); 141 - if (IS_ERR_OR_NULL(rpdata->en_gpiod)) { 139 + rpdata->en_gpiod = devm_fwnode_gpiod_get(tps->dev, of_fwnode_handle(np), 140 + "enable", GPIOD_ASIS, 141 + "enable"); 142 + if (IS_ERR(rpdata->en_gpiod)) { 142 143 ret = PTR_ERR(rpdata->en_gpiod); 143 144 144 145 /* Ignore the error other than probe defer */ ··· 148 147 return 0; 149 148 } 150 149 151 - rpdata->act_dis_gpiod = devm_fwnode_get_index_gpiod_from_child( 152 - tps->dev, "active-discharge", 0, 153 - &np->fwnode, 0, "active-discharge"); 154 - if (IS_ERR_OR_NULL(rpdata->act_dis_gpiod)) { 150 + rpdata->act_dis_gpiod = devm_fwnode_gpiod_get(tps->dev, 151 + of_fwnode_handle(np), 152 + "active-discharge", 153 + GPIOD_ASIS, 154 + "active-discharge"); 155 + if (IS_ERR(rpdata->act_dis_gpiod)) { 155 156 ret = PTR_ERR(rpdata->act_dis_gpiod); 156 157 157 158 /* Ignore the error other than probe defer */