Skip to content

Commit e0bcb68

Browse files
Sergei Shtylyovbroonie
authored andcommitted
spi: use of_property_read_bool()
Use a bit more compact of_property_read_bool() calls instead of the of_find_property() calls -- symmetrically with the of_property_read_u32() calls already done in of_spi_parse_dt(). Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 2856670 commit e0bcb68

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/spi/spi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,15 +1532,15 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
15321532
int rc;
15331533

15341534
/* Mode (clock phase/polarity/etc.) */
1535-
if (of_find_property(nc, "spi-cpha", NULL))
1535+
if (of_property_read_bool(nc, "spi-cpha"))
15361536
spi->mode |= SPI_CPHA;
1537-
if (of_find_property(nc, "spi-cpol", NULL))
1537+
if (of_property_read_bool(nc, "spi-cpol"))
15381538
spi->mode |= SPI_CPOL;
1539-
if (of_find_property(nc, "spi-cs-high", NULL))
1539+
if (of_property_read_bool(nc, "spi-cs-high"))
15401540
spi->mode |= SPI_CS_HIGH;
1541-
if (of_find_property(nc, "spi-3wire", NULL))
1541+
if (of_property_read_bool(nc, "spi-3wire"))
15421542
spi->mode |= SPI_3WIRE;
1543-
if (of_find_property(nc, "spi-lsb-first", NULL))
1543+
if (of_property_read_bool(nc, "spi-lsb-first"))
15441544
spi->mode |= SPI_LSB_FIRST;
15451545

15461546
/* Device DUAL/QUAD mode */

0 commit comments

Comments
 (0)