gpio: Use of_property_read_bool() for boolean properties
PATCH 1/1 gpio: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool().
--- drivers/gpio/gpio-stp-xway.c | 2 +- drivers/gpio/gpio-tb10x.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-stp-xway.c +1 -1
@@ -292,7 +292,7 @@ static int xway_stp_probe(struct platform_device *pdev) }/* check which edge trigger we should use, default to a falling edge */ -if (!of_find_property (pdev->dev.of_node,"lantiq,rising" ,NULL )) +if (!of_property_present (pdev->dev.of_node,"lantiq,rising" )) chip->edge =XWAY_STP_FALLING ; clk =devm_clk_get (&pdev->dev,NULL );
drivers/gpio/gpio-tb10x.c +1 -1
@@ -167,7 +167,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)platform_set_drvdata (pdev, tb10x_gpio); -if (of_find_property (np,"interrupt-controller" ,NULL )) { +if (of_property_present (np,"interrupt-controller" )) {struct irq_chip_generic *gc; ret =platform_get_irq (pdev,0 );
Signature · 1 line
2.39.2
Quoted 6 lines · Rob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to
of_property_read_bool().Signed-off-by Rob Herring <[email protected]>
You are using of_property_present() rather than of_property_read_bool() but I'm not picky about commit message details.
Yours,
Linus Walleij
Quoted 8 lines · Linus Walleij
Quoted 5 lines · Rob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to
of_property_read_bool().
Quoted 4 lines
Quoted 1 line
Signed-off-by Rob Herring <[email protected]>You are using
of_property_present()rather thanof_property_read_bool()but I'm not picky about commit message details.
ugg, well, it's the commit message that's correct. I missed updating this one to use of_property_read_bool().
Rob
Quoted 4 lines
Reviewed-by Linus Walleij <[email protected]>Yours,
Linus Walleij