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

Jagan Teki jagan at openedev.com
Sat Nov 26 04:28:06 CET 2016


On Sat, Nov 26, 2016 at 1:08 AM, Simon Glass <sjg at chromium.org> wrote:
> Hi,
>
> On 25 November 2016 at 09:59, Fabio Estevam <festevam at gmail.com> wrote:
>> On Fri, Nov 25, 2016 at 2:57 PM, Jagan Teki <jagan at openedev.com> 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 also matches with the kernel behaviour.
>
> 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:
> 1. debug() and return an error
> 2. debug() and skip the error

I prefer 2. for SPL and replace debug with printf for U-Boot.

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


More information about the U-Boot mailing list