lkml.org 
[lkml]   [2011]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging:rts_pstor:Fix SDIO issue
Adding the check for if (sd_check_err_code(chip, SD_NO_CARD)) is
good, but introducing the new "reset_pass" variable is wrong.

I don't think you are updating the new variable consistently on
all paths. For example, if it's a 0x5209 chip and the code is like
this:
retval = sd_change_bank_voltage(chip, SD_IO_3V3);
if (retval != STATUS_SUCCESS) {
TRACE_RET(chip, STATUS_FAIL);
}

In the old system that was considered a successful reset, but under
your new system we don't update "reset_pass" here so we pass this
test and then we immediately return STATUS_FAIL because reset_pass
isn't set. If that's what you intended then just write it like that.

retval = sd_change_bank_voltage(chip, SD_IO_3V3);
TRACE_RET(chip, STATUS_FAIL);

So could you write it again but just set retval = STATUS_FAIL; for
the new failure pathes. Or better yet, just return STATUS_FAIL
directly. So this code would be:

> + if (retval == STATUS_SUCCESS)
> + reset_pass = 1;

if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval);
regards,
dan carpenter




\
 
 \ /
  Last update: 2011-10-09 08:11    [W:0.055 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site