Skip to content

Commit 86db3f0

Browse files
robherringlinusw
authored andcommitted
pinctrl: Use of_property_present() for non-boolean properties
The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence. Signed-off-by: Rob Herring (Arm) <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 546ee7b commit 86db3f0

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

drivers/pinctrl/freescale/pinctrl-imx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,11 +633,11 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
633633
static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np)
634634
{
635635
for_each_child_of_node_scoped(np, function_np) {
636-
if (of_property_read_bool(function_np, "fsl,pins"))
636+
if (of_property_present(function_np, "fsl,pins"))
637637
return true;
638638

639639
for_each_child_of_node_scoped(function_np, pinctrl_np) {
640-
if (of_property_read_bool(pinctrl_np, "fsl,pins"))
640+
if (of_property_present(pinctrl_np, "fsl,pins"))
641641
return false;
642642
}
643643
}
@@ -746,7 +746,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
746746
if (IS_ERR(ipctl->base))
747747
return PTR_ERR(ipctl->base);
748748

749-
if (of_property_read_bool(dev_np, "fsl,input-sel")) {
749+
if (of_property_present(dev_np, "fsl,input-sel")) {
750750
np = of_parse_phandle(dev_np, "fsl,input-sel", 0);
751751
if (!np) {
752752
dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n");

drivers/pinctrl/pinctrl-xway.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
15241524
* files which don't set the "gpio-ranges" property or systems that
15251525
* utilize ACPI the driver has to call gpiochip_add_pin_range().
15261526
*/
1527-
if (!of_property_read_bool(pdev->dev.of_node, "gpio-ranges")) {
1527+
if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) {
15281528
/* finish with registering the gpio range in pinctrl */
15291529
xway_gpio_range.npins = xway_chip.ngpio;
15301530
xway_gpio_range.base = xway_chip.base;

drivers/pinctrl/qcom/pinctrl-msm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
14571457
* files which don't set the "gpio-ranges" property or systems that
14581458
* utilize ACPI the driver has to call gpiochip_add_pin_range().
14591459
*/
1460-
if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
1460+
if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
14611461
ret = gpiochip_add_pin_range(&pctrl->chip,
14621462
dev_name(pctrl->dev), 0, 0, chip->ngpio);
14631463
if (ret) {

drivers/pinctrl/qcom/pinctrl-spmi-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ static int pmic_gpio_probe(struct platform_device *pdev)
11691169
* files which don't set the "gpio-ranges" property or systems that
11701170
* utilize ACPI the driver has to call gpiochip_add_pin_range().
11711171
*/
1172-
if (!of_property_read_bool(dev->of_node, "gpio-ranges")) {
1172+
if (!of_property_present(dev->of_node, "gpio-ranges")) {
11731173
ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0,
11741174
npins);
11751175
if (ret) {

drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
832832
* files which don't set the "gpio-ranges" property or systems that
833833
* utilize ACPI the driver has to call gpiochip_add_pin_range().
834834
*/
835-
if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
835+
if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
836836
ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev),
837837
0, 0, pctrl->chip.ngpio);
838838
if (ret) {

0 commit comments

Comments
 (0)