Skip to content

Commit 928f4de

Browse files
committed
sparc: 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/20230310144700.1541345-1-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 6a71ca7 commit 928f4de

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

arch/sparc/kernel/pci_schizo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
12701270
pbm->chip_version >= 0x2)
12711271
tmp |= 0x3UL << SCHIZO_PCICTRL_PTO_SHIFT;
12721272

1273-
if (!of_find_property(pbm->op->dev.of_node, "no-bus-parking", NULL))
1273+
if (!of_property_read_bool(pbm->op->dev.of_node, "no-bus-parking"))
12741274
tmp |= SCHIZO_PCICTRL_PARK;
12751275
else
12761276
tmp &= ~SCHIZO_PCICTRL_PARK;

arch/sparc/kernel/power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static int has_button_interrupt(unsigned int irq, struct device_node *dp)
2828
{
2929
if (irq == 0xffffffff)
3030
return 0;
31-
if (!of_find_property(dp, "button", NULL))
31+
if (!of_property_read_bool(dp, "button"))
3232
return 0;
3333

3434
return 1;

0 commit comments

Comments
 (0)