[U-Boot] [PATCH 2/3] mxs_ocotp: check for errors from the OTP controller after writing

Fabio Estevam
2014-11-22T19:31:10Z

On Sat, Nov 22, 2014 at 5:29 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Fri, Nov 21, 2014 at 4:04 PM, Hector Palacios
> <hector.palacios@digi.com> wrote:
>
>>> What about doing this instead?
>>>
>>> /* Check for errors */
>>> ret = readl(&ocotp_regs->hw_ocotp_ctrl) & OCOTP_CTRL_ERROR);
>>> if (ret) {
>>> printfs("Failed writing the fuses: %d\n", ret);
>>> goto fail;
>>> }
>>>
>>
>> Although the code looks nicer you are not returning a meaningful error code, just a
>> mask value (and yes, I know the error code does not get anywhere, but still).
>
> I am just returning the real error code, not a 'fake' one :-)

Actually your code is correct and I misread it. Sorry about that.