[U-Boot] [PATCH v3] spi: Add error checking for invalid bus widths

Jagan Teki jagan at openedev.com
Thu Dec 1 13:45:58 CET 2016


On Wed, Nov 30, 2016 at 8:30 AM, Simon Glass <sjg at chromium.org> wrote:
> 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 <sjg at chromium.org>
> ---
>
> Changes in v3:
> - Display an error in U-Boot proper, but then continue
> - Drop patches previously applied
>
>  drivers/spi/spi-uclass.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
> index f59a701..1ab5b75 100644
> --- a/drivers/spi/spi-uclass.c
> +++ b/drivers/spi/spi-uclass.c
> @@ -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);

I thought in SPL it will reverse like debug and return by error, make sense?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.


More information about the U-Boot mailing list