mmc: sdhci: fix the wrong type of curr
authorChuanxiao.Dong <chuanxiao.dong@intel.com>
Fri, 1 Aug 2014 06:00:13 +0000 (14:00 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 9 Sep 2014 11:59:00 +0000 (13:59 +0200)
curr should use signed type since it will contain the returned
value which is possible to be a negative value. Using u32 will
make the returned value to be true even there is a negative result.
Change to use int instead of u32

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index 37b2a9ae52eff16cd44649f42fb4822ff05c89db..d25deff305a5e2a506762196e9a53b467b0bb73a 100644 (file)
@@ -3049,7 +3049,7 @@ int sdhci_add_host(struct sdhci_host *host)
         */
        max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
        if (!max_current_caps && !IS_ERR(mmc->supply.vmmc)) {
-               u32 curr = regulator_get_current_limit(mmc->supply.vmmc);
+               int curr = regulator_get_current_limit(mmc->supply.vmmc);
                if (curr > 0) {
 
                        /* convert to SDHCI_MAX_CURRENT format */
This page took 0.026856 seconds and 5 git commands to generate.