Skip to content

Commit 6da07bd

Browse files
committed
w1: w1-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(). Link: https://lore.kernel.org/r/20230310144737.1547200-1-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 10ce6b7 commit 6da07bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/w1/masters/w1-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int w1_gpio_probe(struct platform_device *pdev)
8787
* driver it high/low like we are in full control of the line and
8888
* open drain will happen transparently.
8989
*/
90-
if (of_get_property(np, "linux,open-drain", NULL))
90+
if (of_property_present(np, "linux,open-drain"))
9191
gflags = GPIOD_OUT_LOW;
9292

9393
pdev->dev.platform_data = pdata;

0 commit comments

Comments
 (0)