[U-Boot] Possible bug in s5p_sdhci.c

Matt Reimer mreimer at sdgsystems.com
Thu Feb 19 19:31:53 CET 2015


The use of SDHCI_CTRL2_SELBASECLK_SHIFT in s5p_sdhci_set_control_reg() seems wrong, because a shifting offset is being used as a mask, not to generate a mask.

It's unclear what the original intent was. Below is my suggested fix.

What think ye?

Matt


diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 3899372..0eec731 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -30,7 +30,7 @@ static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
        sdhci_writel(host, SDHCI_CTRL4_DRIVE_MASK(0x3), SDHCI_CONTROL4);
 
        val = sdhci_readl(host, SDHCI_CONTROL2);
-       val &= SDHCI_CTRL2_SELBASECLK_SHIFT;
+       val &= SDHCI_CTRL2_SELBASECLK_MASK(3);
 
        val |=  SDHCI_CTRL2_ENSTAASYNCCLR |
                SDHCI_CTRL2_ENCMDCNFMSK |





More information about the U-Boot mailing list