mmc: dw_mmc: Convert to mmc_send_tuning()
[deliverable/linux.git] / drivers / mmc / host / dw_mmc.c
index 6e4d864b50ef09cfb6f361a25c220a80b430f911..2e8abc8b196bf18c0b098ac8c84eba66d1b9e94c 100644 (file)
@@ -314,7 +314,9 @@ static u32 dw_mci_prep_stop_abort(struct dw_mci *host, struct mmc_command *cmd)
        if (cmdr == MMC_READ_SINGLE_BLOCK ||
            cmdr == MMC_READ_MULTIPLE_BLOCK ||
            cmdr == MMC_WRITE_BLOCK ||
-           cmdr == MMC_WRITE_MULTIPLE_BLOCK) {
+           cmdr == MMC_WRITE_MULTIPLE_BLOCK ||
+           cmdr == MMC_SEND_TUNING_BLOCK ||
+           cmdr == MMC_SEND_TUNING_BLOCK_HS200) {
                stop->opcode = MMC_STOP_TRANSMISSION;
                stop->arg = 0;
                stop->flags = MMC_RSP_R1B | MMC_CMD_AC;
@@ -1312,30 +1314,10 @@ static int dw_mci_execute_tuning(struct mmc_host *mmc, u32 opcode)
        struct dw_mci_slot *slot = mmc_priv(mmc);
        struct dw_mci *host = slot->host;
        const struct dw_mci_drv_data *drv_data = host->drv_data;
-       struct dw_mci_tuning_data tuning_data;
        int err = -ENOSYS;
 
-       if (opcode == MMC_SEND_TUNING_BLOCK_HS200) {
-               if (mmc->ios.bus_width == MMC_BUS_WIDTH_8) {
-                       tuning_data.blk_pattern = tuning_blk_pattern_8bit;
-                       tuning_data.blksz = sizeof(tuning_blk_pattern_8bit);
-               } else if (mmc->ios.bus_width == MMC_BUS_WIDTH_4) {
-                       tuning_data.blk_pattern = tuning_blk_pattern_4bit;
-                       tuning_data.blksz = sizeof(tuning_blk_pattern_4bit);
-               } else {
-                       return -EINVAL;
-               }
-       } else if (opcode == MMC_SEND_TUNING_BLOCK) {
-               tuning_data.blk_pattern = tuning_blk_pattern_4bit;
-               tuning_data.blksz = sizeof(tuning_blk_pattern_4bit);
-       } else {
-               dev_err(host->dev,
-                       "Undefined command(%d) for tuning\n", opcode);
-               return -EINVAL;
-       }
-
        if (drv_data && drv_data->execute_tuning)
-               err = drv_data->execute_tuning(slot, opcode, &tuning_data);
+               err = drv_data->execute_tuning(slot);
        return err;
 }
 
This page took 0.023955 seconds and 5 git commands to generate.