Commit b98e7e8d authored by ChanWoo Lee's avatar ChanWoo Lee Committed by Ulf Hansson
Browse files

mmc: Avoid open coding by using mmc_op_tuning()



Replace code with the already defined function. No functional changes.

Signed-off-by: default avatarChanWoo Lee <cw9316.lee@samsung.com>
Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20221124080031.14690-1-cw9316.lee@samsung.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 1e8cb505
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -142,8 +142,7 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
	int err = cmd->error;

	/* Flag re-tuning needed on CRC errors */
	if (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
	    cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200 &&
	if (!mmc_op_tuning(cmd->opcode) &&
	    !host->retune_crc_disable &&
	    (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
	    (mrq->data && mrq->data->error == -EILSEQ) ||
+1 −2
Original line number Diff line number Diff line
@@ -334,8 +334,7 @@ static u32 dw_mci_prep_stop_abort(struct dw_mci *host, struct mmc_command *cmd)
	    cmdr == MMC_READ_MULTIPLE_BLOCK ||
	    cmdr == MMC_WRITE_BLOCK ||
	    cmdr == MMC_WRITE_MULTIPLE_BLOCK ||
	    cmdr == MMC_SEND_TUNING_BLOCK ||
	    cmdr == MMC_SEND_TUNING_BLOCK_HS200 ||
	    mmc_op_tuning(cmdr) ||
	    cmdr == MMC_GEN_CMD) {
		stop->opcode = MMC_STOP_TRANSMISSION;
		stop->arg = 0;
+2 −6
Original line number Diff line number Diff line
@@ -1224,9 +1224,7 @@ static bool msdc_cmd_done(struct msdc_host *host, int events,

	if (!sbc_error && !(events & MSDC_INT_CMDRDY)) {
		if (events & MSDC_INT_CMDTMO ||
		    (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
		     cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200 &&
		     !host->hs400_tuning))
		    (!mmc_op_tuning(cmd->opcode) && !host->hs400_tuning))
			/*
			 * should not clear fifo/interrupt as the tune data
			 * may have already come when cmd19/cmd21 gets response
@@ -1320,9 +1318,7 @@ static void msdc_cmd_next(struct msdc_host *host,
{
	if ((cmd->error &&
	    !(cmd->error == -EILSEQ &&
	      (cmd->opcode == MMC_SEND_TUNING_BLOCK ||
	       cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200 ||
	       host->hs400_tuning))) ||
	      (mmc_op_tuning(cmd->opcode) || host->hs400_tuning))) ||
	    (mrq->sbc && mrq->sbc->error))
		msdc_request_done(host, mrq);
	else if (cmd == mrq->sbc)
+1 −2
Original line number Diff line number Diff line
@@ -2219,8 +2219,7 @@ static int __sdhci_msm_check_write(struct sdhci_host *host, u16 val, int reg)
		if (!msm_host->use_cdr)
			break;
		if ((msm_host->transfer_mode & SDHCI_TRNS_READ) &&
		    SDHCI_GET_CMD(val) != MMC_SEND_TUNING_BLOCK_HS200 &&
		    SDHCI_GET_CMD(val) != MMC_SEND_TUNING_BLOCK)
		    !mmc_op_tuning(SDHCI_GET_CMD(val)))
			sdhci_msm_set_cdr(host, true);
		else
			sdhci_msm_set_cdr(host, false);
+1 −2
Original line number Diff line number Diff line
@@ -326,8 +326,7 @@ static int sdhci_o2_execute_tuning(struct mmc_host *mmc, u32 opcode)
		(host->timing != MMC_TIMING_UHS_SDR50))
		return sdhci_execute_tuning(mmc, opcode);

	if (WARN_ON((opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
			(opcode != MMC_SEND_TUNING_BLOCK)))
	if (WARN_ON(!mmc_op_tuning(opcode)))
		return -EINVAL;

	/* Force power mode enter L0 */
Loading