Skip to content

Commit

Permalink
staging/rts_pstor: remove braces {} in sd.c (reset_mmc)
Browse files Browse the repository at this point in the history
fixed below checkpatch warnings.
-WARNING: braces {} are not necessary for any arm of this statement
-WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Toshiaki Yamane authored and Greg Kroah-Hartman committed Sep 10, 2012
1 parent 35918dd commit d8701f8
Showing 1 changed file with 19 additions and 33 deletions.
52 changes: 19 additions & 33 deletions drivers/staging/rts_pstor/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2804,17 +2804,15 @@ static int reset_mmc(struct rtsx_chip *chip)

Switch_Fail:
retval = sd_prepare_reset(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval);
}

SET_MMC(sd_card);

RTY_MMC_RST:
retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, SD_RSP_TYPE_R0, NULL, 0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

do {
if (detect_card_cd(chip, SD_CARD) != STATUS_SUCCESS) {
Expand Down Expand Up @@ -2848,56 +2846,47 @@ static int reset_mmc(struct rtsx_chip *chip)
i++;
} while (!(rsp[1] & 0x80) && (i < 255));

if (i == 255) {
if (i == 255)
TRACE_RET(chip, STATUS_FAIL);
}

if ((rsp[1] & 0x60) == 0x40) {
if ((rsp[1] & 0x60) == 0x40)
SET_MMC_SECTOR_MODE(sd_card);
} else {
else
CLR_MMC_SECTOR_MODE(sd_card);
}

retval = sd_send_cmd_get_rsp(chip, ALL_SEND_CID, 0, SD_RSP_TYPE_R2, NULL, 0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

sd_card->sd_addr = 0x00100000;
retval = sd_send_cmd_get_rsp(chip, SET_RELATIVE_ADDR, sd_card->sd_addr, SD_RSP_TYPE_R6, rsp, 5);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

retval = sd_check_csd(chip, 1);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

spec_ver = (sd_card->raw_csd[0] & 0x3C) >> 2;

retval = sd_select_card(chip, 1);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

retval = sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200, SD_RSP_TYPE_R1, NULL, 0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

#ifdef SUPPORT_SD_LOCK
MMC_UNLOCK_ENTRY:
retval = sd_update_lock_status(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}
#endif

retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

chip->card_bus_width[chip->card2lun[SD_CARD]] = 1;

Expand All @@ -2914,22 +2903,20 @@ static int reset_mmc(struct rtsx_chip *chip)
}
}

if (CHK_MMC_SECTOR_MODE(sd_card) && (sd_card->capacity == 0)) {
if (CHK_MMC_SECTOR_MODE(sd_card) && (sd_card->capacity == 0))
TRACE_RET(chip, STATUS_FAIL);
}

if (switch_ddr && CHK_MMC_DDR52(sd_card)) {
retval = sd_set_init_para(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

retval = mmc_ddr_tuning(chip);
if (retval != STATUS_SUCCESS) {
retval = sd_init_power(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

switch_ddr = 0;
TRACE_GOTO(chip, Switch_Fail);
}
Expand All @@ -2939,9 +2926,9 @@ static int reset_mmc(struct rtsx_chip *chip)
retval = sd_read_lba0(chip);
if (retval != STATUS_SUCCESS) {
retval = sd_init_power(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL);
}

switch_ddr = 0;
TRACE_GOTO(chip, Switch_Fail);
}
Expand All @@ -2957,9 +2944,8 @@ static int reset_mmc(struct rtsx_chip *chip)
#endif

temp = rtsx_readl(chip, RTSX_BIPR);
if (temp & SD_WRITE_PROTECT) {
if (temp & SD_WRITE_PROTECT)
chip->card_wp |= SD_CARD;
}

return STATUS_SUCCESS;
}
Expand Down

0 comments on commit d8701f8

Please sign in to comment.