Skip to content

Commit

Permalink
spi: use of_property_read_bool()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Sergei Shtylyov authored and broonie committed Aug 7, 2017
1 parent 2856670 commit e0bcb68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,15 +1532,15 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
int rc;

/* Mode (clock phase/polarity/etc.) */
if (of_find_property(nc, "spi-cpha", NULL))
if (of_property_read_bool(nc, "spi-cpha"))
spi->mode |= SPI_CPHA;
if (of_find_property(nc, "spi-cpol", NULL))
if (of_property_read_bool(nc, "spi-cpol"))
spi->mode |= SPI_CPOL;
if (of_find_property(nc, "spi-cs-high", NULL))
if (of_property_read_bool(nc, "spi-cs-high"))
spi->mode |= SPI_CS_HIGH;
if (of_find_property(nc, "spi-3wire", NULL))
if (of_property_read_bool(nc, "spi-3wire"))
spi->mode |= SPI_3WIRE;
if (of_find_property(nc, "spi-lsb-first", NULL))
if (of_property_read_bool(nc, "spi-lsb-first"))
spi->mode |= SPI_LSB_FIRST;

/* Device DUAL/QUAD mode */
Expand Down

0 comments on commit e0bcb68

Please sign in to comment.