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: 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 <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20220903-gpiod_get_from_of_node-remove-v1-9-b29adfb27a6c@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dmitry Torokhov and committed by
Mark Brown
587bfe3f 97c9278e

+9 -8
+9 -8
drivers/regulator/bd9576-regulator.c
··· 12 12 #include <linux/module.h> 13 13 #include <linux/of.h> 14 14 #include <linux/platform_device.h> 15 + #include <linux/property.h> 15 16 #include <linux/regulator/driver.h> 16 17 #include <linux/regulator/machine.h> 17 18 #include <linux/regulator/of_regulator.h> ··· 940 939 } 941 940 942 941 ic_data->regmap = regmap; 943 - vout_mode = of_property_read_bool(pdev->dev.parent->of_node, 944 - "rohm,vout1-en-low"); 942 + vout_mode = device_property_read_bool(pdev->dev.parent, 943 + "rohm,vout1-en-low"); 945 944 if (vout_mode) { 946 945 struct gpio_desc *en; 947 946 ··· 949 948 950 949 /* VOUT1 enable state judged by VOUT1_EN pin */ 951 950 /* See if we have GPIO defined */ 952 - en = devm_gpiod_get_from_of_node(&pdev->dev, 953 - pdev->dev.parent->of_node, 954 - "rohm,vout1-en-gpios", 0, 955 - GPIOD_OUT_LOW, "vout1-en"); 951 + en = devm_fwnode_gpiod_get(&pdev->dev, 952 + dev_fwnode(pdev->dev.parent), 953 + "rohm,vout1-en", GPIOD_OUT_LOW, 954 + "vout1-en"); 956 955 if (!IS_ERR(en)) { 957 956 /* VOUT1_OPS gpio ctrl */ 958 957 /* ··· 987 986 * like DDR voltage selection. 988 987 */ 989 988 platform_set_drvdata(pdev, ic_data); 990 - ddr_sel = of_property_read_bool(pdev->dev.parent->of_node, 991 - "rohm,ddr-sel-low"); 989 + ddr_sel = device_property_read_bool(pdev->dev.parent, 990 + "rohm,ddr-sel-low"); 992 991 if (ddr_sel) 993 992 ic_data->regulator_data[2].desc.fixed_uV = 1350000; 994 993 else