Commit d8701f8b authored by Toshiaki Yamane's avatar Toshiaki Yamane Committed by Greg Kroah-Hartman

staging/rts_pstor: remove braces {} in sd.c (reset_mmc)

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: default avatarToshiaki Yamane <yamanetoshi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35918dda
...@@ -2804,17 +2804,15 @@ static int reset_mmc(struct rtsx_chip *chip) ...@@ -2804,17 +2804,15 @@ static int reset_mmc(struct rtsx_chip *chip)
Switch_Fail: Switch_Fail:
retval = sd_prepare_reset(chip); retval = sd_prepare_reset(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, retval); TRACE_RET(chip, retval);
}
SET_MMC(sd_card); SET_MMC(sd_card);
RTY_MMC_RST: RTY_MMC_RST:
retval = sd_send_cmd_get_rsp(chip, GO_IDLE_STATE, 0, SD_RSP_TYPE_R0, NULL, 0); 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); TRACE_RET(chip, STATUS_FAIL);
}
do { do {
if (detect_card_cd(chip, SD_CARD) != STATUS_SUCCESS) { if (detect_card_cd(chip, SD_CARD) != STATUS_SUCCESS) {
...@@ -2848,56 +2846,47 @@ static int reset_mmc(struct rtsx_chip *chip) ...@@ -2848,56 +2846,47 @@ static int reset_mmc(struct rtsx_chip *chip)
i++; i++;
} while (!(rsp[1] & 0x80) && (i < 255)); } while (!(rsp[1] & 0x80) && (i < 255));
if (i == 255) { if (i == 255)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
if ((rsp[1] & 0x60) == 0x40) { if ((rsp[1] & 0x60) == 0x40)
SET_MMC_SECTOR_MODE(sd_card); SET_MMC_SECTOR_MODE(sd_card);
} else { else
CLR_MMC_SECTOR_MODE(sd_card); CLR_MMC_SECTOR_MODE(sd_card);
}
retval = sd_send_cmd_get_rsp(chip, ALL_SEND_CID, 0, SD_RSP_TYPE_R2, NULL, 0); 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); TRACE_RET(chip, STATUS_FAIL);
}
sd_card->sd_addr = 0x00100000; 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); 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); TRACE_RET(chip, STATUS_FAIL);
}
retval = sd_check_csd(chip, 1); retval = sd_check_csd(chip, 1);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
spec_ver = (sd_card->raw_csd[0] & 0x3C) >> 2; spec_ver = (sd_card->raw_csd[0] & 0x3C) >> 2;
retval = sd_select_card(chip, 1); retval = sd_select_card(chip, 1);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
retval = sd_send_cmd_get_rsp(chip, SET_BLOCKLEN, 0x200, SD_RSP_TYPE_R1, NULL, 0); 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); TRACE_RET(chip, STATUS_FAIL);
}
#ifdef SUPPORT_SD_LOCK #ifdef SUPPORT_SD_LOCK
MMC_UNLOCK_ENTRY: MMC_UNLOCK_ENTRY:
retval = sd_update_lock_status(chip); retval = sd_update_lock_status(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
#endif #endif
retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0); retval = sd_set_clock_divider(chip, SD_CLK_DIVIDE_0);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
chip->card_bus_width[chip->card2lun[SD_CARD]] = 1; chip->card_bus_width[chip->card2lun[SD_CARD]] = 1;
...@@ -2914,22 +2903,20 @@ static int reset_mmc(struct rtsx_chip *chip) ...@@ -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); TRACE_RET(chip, STATUS_FAIL);
}
if (switch_ddr && CHK_MMC_DDR52(sd_card)) { if (switch_ddr && CHK_MMC_DDR52(sd_card)) {
retval = sd_set_init_para(chip); retval = sd_set_init_para(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
retval = mmc_ddr_tuning(chip); retval = mmc_ddr_tuning(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
retval = sd_init_power(chip); retval = sd_init_power(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
switch_ddr = 0; switch_ddr = 0;
TRACE_GOTO(chip, Switch_Fail); TRACE_GOTO(chip, Switch_Fail);
} }
...@@ -2939,9 +2926,9 @@ static int reset_mmc(struct rtsx_chip *chip) ...@@ -2939,9 +2926,9 @@ static int reset_mmc(struct rtsx_chip *chip)
retval = sd_read_lba0(chip); retval = sd_read_lba0(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
retval = sd_init_power(chip); retval = sd_init_power(chip);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS)
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
}
switch_ddr = 0; switch_ddr = 0;
TRACE_GOTO(chip, Switch_Fail); TRACE_GOTO(chip, Switch_Fail);
} }
...@@ -2957,9 +2944,8 @@ static int reset_mmc(struct rtsx_chip *chip) ...@@ -2957,9 +2944,8 @@ static int reset_mmc(struct rtsx_chip *chip)
#endif #endif
temp = rtsx_readl(chip, RTSX_BIPR); temp = rtsx_readl(chip, RTSX_BIPR);
if (temp & SD_WRITE_PROTECT) { if (temp & SD_WRITE_PROTECT)
chip->card_wp |= SD_CARD; chip->card_wp |= SD_CARD;
}
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment