Skip to content

Commit 915be48

Browse files
Dong Aishengstorulf
authored andcommitted
mmc: sdhci-esdhc-imx: merge the same register check into one place
In esdhc_writel_le() function, there's duplicated checking of the same register as follows: "if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE))". Merge them into one and remove the duplicated one. Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent b69587e commit 915be48

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg)
313313
data |= ESDHC_CTRL_D3CD;
314314
writel(data, host->ioaddr + SDHCI_HOST_CONTROL);
315315
}
316+
317+
if (val & SDHCI_INT_ADMA_ERROR) {
318+
val &= ~SDHCI_INT_ADMA_ERROR;
319+
val |= ESDHC_INT_VENDOR_SPEC_DMA_ERR;
320+
}
316321
}
317322

318323
if (unlikely((imx_data->socdata->flags & ESDHC_FLAG_MULTIBLK_NO_INT)
@@ -333,13 +338,6 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg)
333338
}
334339
}
335340

336-
if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) {
337-
if (val & SDHCI_INT_ADMA_ERROR) {
338-
val &= ~SDHCI_INT_ADMA_ERROR;
339-
val |= ESDHC_INT_VENDOR_SPEC_DMA_ERR;
340-
}
341-
}
342-
343341
writel(val, host->ioaddr + reg);
344342
}
345343

0 commit comments

Comments
 (0)