Skip to content

Commit 43b0b36

Browse files
Masaharu Hayakawastorulf
authored andcommitted
mmc: tmio: always get number of taps
Current code gets number of taps only once and keeps the value. This is not correct, we need to obtain it every time before executing tuning, so remove the outer if-block. Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com> [wsa: extracted from a larger patch and reworded commit message] Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 5f07ef8 commit 43b0b36

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

drivers/mmc/host/tmio_mmc_pio.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -815,16 +815,14 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
815815
struct tmio_mmc_host *host = mmc_priv(mmc);
816816
int i, ret = 0;
817817

818-
if (!host->tap_num) {
819-
if (!host->init_tuning || !host->select_tuning)
820-
/* Tuning is not supported */
821-
goto out;
818+
if (!host->init_tuning || !host->select_tuning)
819+
/* Tuning is not supported */
820+
goto out;
822821

823-
host->tap_num = host->init_tuning(host);
824-
if (!host->tap_num)
825-
/* Tuning is not supported */
826-
goto out;
827-
}
822+
host->tap_num = host->init_tuning(host);
823+
if (!host->tap_num)
824+
/* Tuning is not supported */
825+
goto out;
828826

829827
if (host->tap_num * 2 >= sizeof(host->taps) * BITS_PER_BYTE) {
830828
dev_warn_once(&host->pdev->dev,

0 commit comments

Comments
 (0)