diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 15:47:15 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-03-22 17:02:17 +0100 |
commit | 57150c40b6391bc350c6016641b2a487a3de3cba (patch) | |
tree | c903efd337f06e4d99d835fb126c7e5ff8fd4275 /drivers/mtd/spi-nor | |
parent | mtd: Avoid magic values (diff) | |
download | linux-57150c40b6391bc350c6016641b2a487a3de3cba.tar.xz linux-57150c40b6391bc350c6016641b2a487a3de3cba.zip |
mtd: 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().
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230310144716.1543995-1-robh@kernel.org
Diffstat (limited to 'drivers/mtd/spi-nor')
-rw-r--r-- | drivers/mtd/spi-nor/controllers/nxp-spifi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/spi-nor/controllers/nxp-spifi.c b/drivers/mtd/spi-nor/controllers/nxp-spifi.c index ab3990e6ac25..794c7b7d5c92 100644 --- a/drivers/mtd/spi-nor/controllers/nxp-spifi.c +++ b/drivers/mtd/spi-nor/controllers/nxp-spifi.c @@ -305,10 +305,10 @@ static int nxp_spifi_setup_flash(struct nxp_spifi *spifi, } } - if (of_find_property(np, "spi-cpha", NULL)) + if (of_property_read_bool(np, "spi-cpha")) mode |= SPI_CPHA; - if (of_find_property(np, "spi-cpol", NULL)) + if (of_property_read_bool(np, "spi-cpol")) mode |= SPI_CPOL; /* Setup control register defaults */ |