Skip to content

Commit

Permalink
spi: Add error checking for invalid bus widths
Browse files Browse the repository at this point in the history
At present an invalid bus width prints a message but does not return an
error. This is the opposite of the correct behaviour. Adjust it to avoid
code bloat in the common case, and avoid hard-to-debug failure in the
uncommon case.

Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
  • Loading branch information
sjg20 authored and openedev committed Dec 15, 2016
1 parent f06e158 commit 1b7c28f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-uclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ int spi_slave_ofdata_to_platdata(const void *blob, int node,
mode |= SPI_TX_QUAD;
break;
default:
error("spi-tx-bus-width %d not supported\n", value);
warn_non_spl("spi-tx-bus-width %d not supported\n", value);
break;
}

Expand All @@ -433,7 +433,7 @@ int spi_slave_ofdata_to_platdata(const void *blob, int node,
mode |= SPI_RX_QUAD;
break;
default:
error("spi-rx-bus-width %d not supported\n", value);
warn_non_spl("spi-rx-bus-width %d not supported\n", value);
break;
}

Expand Down

0 comments on commit 1b7c28f

Please sign in to comment.