mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
regulator: bd71815: switch to devm_fwnode_gpiod_get_optional
Use the devm_fwnode_gpiod_get_optional variant to simplify the error handling code. Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.kernel.org/r/20260126-gpio-devm_fwnode_gpiod_get_optional-v2-2-ec34f8e35077@pengutronix.de Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
parent
364713741c
commit
09b174f1a5
1 changed files with 6 additions and 9 deletions
|
|
@ -571,15 +571,12 @@ static int bd7181x_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
ldo4_en = devm_fwnode_gpiod_get(&pdev->dev,
|
||||
dev_fwnode(pdev->dev.parent),
|
||||
"rohm,vsel", GPIOD_ASIS, "ldo4-en");
|
||||
if (IS_ERR(ldo4_en)) {
|
||||
ret = PTR_ERR(ldo4_en);
|
||||
if (ret != -ENOENT)
|
||||
return ret;
|
||||
ldo4_en = NULL;
|
||||
}
|
||||
ldo4_en = devm_fwnode_gpiod_get_optional(&pdev->dev,
|
||||
dev_fwnode(pdev->dev.parent),
|
||||
"rohm,vsel", GPIOD_ASIS,
|
||||
"ldo4-en");
|
||||
if (IS_ERR(ldo4_en))
|
||||
return PTR_ERR(ldo4_en);
|
||||
|
||||
/* Disable to go to ship-mode */
|
||||
ret = regmap_update_bits(regmap, BD71815_REG_PWRCTRL, RESTARTEN, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue