Skip to content

Commit 587bfe3

Browse files
dtorbroonie
authored andcommitted
regulator: bd9576: switch to using devm_fwnode_gpiod_get()
I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. While at it switch the rest of the calls to read properties in bd957x_probe() to the generic device property API as well. Signed-off-by: Dmitry Torokhov <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-9-b29adfb27a6c@gmail.com Signed-off-by: Mark Brown <[email protected]>
1 parent 97c9278 commit 587bfe3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/regulator/bd9576-regulator.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/module.h>
1313
#include <linux/of.h>
1414
#include <linux/platform_device.h>
15+
#include <linux/property.h>
1516
#include <linux/regulator/driver.h>
1617
#include <linux/regulator/machine.h>
1718
#include <linux/regulator/of_regulator.h>
@@ -939,19 +940,19 @@ static int bd957x_probe(struct platform_device *pdev)
939940
}
940941

941942
ic_data->regmap = regmap;
942-
vout_mode = of_property_read_bool(pdev->dev.parent->of_node,
943-
"rohm,vout1-en-low");
943+
vout_mode = device_property_read_bool(pdev->dev.parent,
944+
"rohm,vout1-en-low");
944945
if (vout_mode) {
945946
struct gpio_desc *en;
946947

947948
dev_dbg(&pdev->dev, "GPIO controlled mode\n");
948949

949950
/* VOUT1 enable state judged by VOUT1_EN pin */
950951
/* See if we have GPIO defined */
951-
en = devm_gpiod_get_from_of_node(&pdev->dev,
952-
pdev->dev.parent->of_node,
953-
"rohm,vout1-en-gpios", 0,
954-
GPIOD_OUT_LOW, "vout1-en");
952+
en = devm_fwnode_gpiod_get(&pdev->dev,
953+
dev_fwnode(pdev->dev.parent),
954+
"rohm,vout1-en", GPIOD_OUT_LOW,
955+
"vout1-en");
955956
if (!IS_ERR(en)) {
956957
/* VOUT1_OPS gpio ctrl */
957958
/*
@@ -986,8 +987,8 @@ static int bd957x_probe(struct platform_device *pdev)
986987
* like DDR voltage selection.
987988
*/
988989
platform_set_drvdata(pdev, ic_data);
989-
ddr_sel = of_property_read_bool(pdev->dev.parent->of_node,
990-
"rohm,ddr-sel-low");
990+
ddr_sel = device_property_read_bool(pdev->dev.parent,
991+
"rohm,ddr-sel-low");
991992
if (ddr_sel)
992993
ic_data->regulator_data[2].desc.fixed_uV = 1350000;
993994
else

0 commit comments

Comments
 (0)