[U-Boot] [PATCH 1/9] wandboard: Return error if the SDHC port index is invalid

Wolfgang Denk wd at denx.de
Tue May 21 23:24:46 CEST 2013


Dear Fabio Estevam,

In message <1369157542-25734-1-git-send-email-fabio.estevam at freescale.com> you wrote:
> When the SDHC port number index is invalid we should return an error code 
> immediately.
> 
> Currently we return 'status', which has a value of zero, causing  
> board_mmc_init() to incorrectly return sucess.
> 
> Fix this by returning -EINVAL instead.

Can we _please_ remove all this code?  A _runtime_ check for a _build_
_time_ _detectable_ situation makes no sense to me.

For such a misconfiguration, the build should fail.

Handling this at runtime is the wrong approach.


This comment applies for the whole series.


Actually - are you not surprised that you have to fix the same issue
for all boards?  This is a clear indication of duplicated code that
needs to be factored out.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are two kinds of people, those who do the work  and  those  who
take  the  credit.  Try  to  be  in  the  first  group; there is less
competition there.                                    - Indira Gandhi


More information about the U-Boot mailing list