[U-Boot] [PATCH v2 10/22] spi: Add error checking for invalid bus widths

Fabio Estevam festevam at gmail.com
Sat Nov 19 15:53:09 CET 2016


Hi Simon,

On Sun, Nov 13, 2016 at 7:22 PM, Simon Glass <sjg at chromium.org> wrote:

>  drivers/spi/spi-uclass.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
> index 26eada2..358e229 100644
> --- a/drivers/spi/spi-uclass.c
> +++ b/drivers/spi/spi-uclass.c
> @@ -415,8 +415,8 @@ 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);
> -               break;
> +               debug("spi-tx-bus-width %d not supported\n", value);
> +               return -EPROTONOSUPPORT;

EPROTONOSUPPORT means: /* Protocol not supported */, which does not
seem to be very appropriate here.

Why not return -EINVAL instead?


More information about the U-Boot mailing list