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

2016-11-29 Thread Simon Glass
Hi, On 25 November 2016 at 20:28, Jagan Teki wrote: > On Sat, Nov 26, 2016 at 1:08 AM, Simon Glass wrote: >> Hi, >> >> On 25 November 2016 at 09:59, Fabio Estevam wrote: >>> On Fri, Nov 25, 2016 at 2:57 PM, Jagan Teki wrote: >>> Yeah, ie what if dts has a wrong value and do print that and

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

2016-11-25 Thread Jagan Teki
On Sat, Nov 26, 2016 at 1:08 AM, Simon Glass wrote: > Hi, > > On 25 November 2016 at 09:59, Fabio Estevam wrote: >> On Fri, Nov 25, 2016 at 2:57 PM, Jagan Teki wrote: >> >>> Yeah, ie what if dts has a wrong value and do print that and continue >>> with default width, so-that the user will update

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

2016-11-25 Thread Fabio Estevam
On Fri, Nov 25, 2016 at 5:38 PM, Simon Glass wrote: > So it is correct to print an error, and then continue? This error will > almost never occur and thus it wastes code space. SPI is sensitive > because it can be used in SPL. Linux doesn't care about code size as > much. > > So how about either:

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

2016-11-25 Thread Simon Glass
Hi, On 25 November 2016 at 09:59, Fabio Estevam wrote: > On Fri, Nov 25, 2016 at 2:57 PM, Jagan Teki wrote: > >> Yeah, ie what if dts has a wrong value and do print that and continue >> with default width, so-that the user will update this for next run. >> Since it's not key a attribute to break

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

2016-11-25 Thread Fabio Estevam
On Fri, Nov 25, 2016 at 2:57 PM, Jagan Teki wrote: > Yeah, ie what if dts has a wrong value and do print that and continue > with default width, so-that the user will update this for next run. > Since it's not key a attribute to break or decide functionality better > to go with it. Agreed. This

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

2016-11-25 Thread Jagan Teki
Hi Simon, On Thu, Nov 24, 2016 at 7:51 AM, Simon Glass wrote: > Hi Jagan, > > On 21 November 2016 at 10:57, Jagan Teki wrote: >> On Sun, Nov 20, 2016 at 2:19 AM, Fabio Estevam wrote: >>> On Sat, Nov 19, 2016 at 6:04 PM, Simon Glass wrote: >>> > EPROTONOSUPPORT means: /* Protocol not suppor

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

2016-11-23 Thread Simon Glass
Hi Jagan, On 21 November 2016 at 10:57, Jagan Teki wrote: > On Sun, Nov 20, 2016 at 2:19 AM, Fabio Estevam wrote: >> On Sat, Nov 19, 2016 at 6:04 PM, Simon Glass wrote: >> EPROTONOSUPPORT means: /* Protocol not supported */, which does not seem to be very appropriate here. >>> >>> Thi

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

2016-11-21 Thread Jagan Teki
On Sun, Nov 20, 2016 at 2:19 AM, Fabio Estevam wrote: > On Sat, Nov 19, 2016 at 6:04 PM, Simon Glass wrote: > >>> EPROTONOSUPPORT means: /* Protocol not supported */, which does not >>> seem to be very appropriate here. >> >> This is a protocol as far as I can see - you can either use one pin or

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

2016-11-19 Thread Simon Glass
Hi Fabio, On 19 November 2016 at 13:49, Fabio Estevam wrote: > On Sat, Nov 19, 2016 at 6:04 PM, Simon Glass wrote: > >>> EPROTONOSUPPORT means: /* Protocol not supported */, which does not >>> seem to be very appropriate here. >> >> This is a protocol as far as I can see - you can either use one

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

2016-11-19 Thread Fabio Estevam
On Sat, Nov 19, 2016 at 6:04 PM, Simon Glass wrote: >> EPROTONOSUPPORT means: /* Protocol not supported */, which does not >> seem to be very appropriate here. > > This is a protocol as far as I can see - you can either use one pin or > four pins. Actually they are SPI modes: one, two or four pi

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

2016-11-19 Thread Simon Glass
Hi, On 19 November 2016 at 07:53, Fabio Estevam wrote: > Hi Simon, > > On Sun, Nov 13, 2016 at 7:22 PM, Simon Glass 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 >> ind

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

2016-11-19 Thread Fabio Estevam
Hi Simon, On Sun, Nov 13, 2016 at 7:22 PM, Simon Glass 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/

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

2016-11-19 Thread Simon Glass
Hi Jagan, On 17 November 2016 at 09:32, Jagan Teki wrote: > On Mon, Nov 14, 2016 at 2:52 AM, Simon Glass 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,

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

2016-11-17 Thread Jagan Teki
On Mon, Nov 14, 2016 at 2:52 AM, Simon Glass 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. > > Sign

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

2016-11-13 Thread Simon Glass
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 --- Changes in v2: None drivers/spi/s