[PATCH] drivers: mtd: m25p80: Add quad read support.

Marek Vasut marex at denx.de
Tue Oct 29 11:24:27 PDT 2013


Dear Sourav Poddar,

[...]

> >>> This way, you can check if the SPI read failed and if so, handle it in
> >>> some way. The return value would only be valid if this function
> >>> returned 0.
> >> 
> >> I got this, but do you think its necessary to have two checks for
> >> verifying whether read passed. ?
> > 
> > Yes of course it is necessary, how else would you be able to tell if the
> > value is valid ? Sure, you can depend on negative integer here and on
> > the fact that the u8 will never be 32-bits wide (to produce a negative
> > integer when the return value is valid), but personally I think this is
> > error-prone as hell.
> > 
> >> If I go by your code above, after returning from above,
> >> check for return value for successful read
> >> and then check the respective bit set(SR_*). ?
> > 
> > Yes, you will be checking the bit in SR only if you are sure the value is
> > valid.
> 
> hmm..alrite I will do the cleanup and send v2.

Brian, does this make sense? I'd hate to misguide someone.

Best regards,
Marek Vasut



More information about the linux-mtd mailing list