Commit ae906037 authored by Chuanxiao.Dong's avatar Chuanxiao.Dong Committed by Ulf Hansson

mmc: sdhci: fix the wrong type of curr

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: default avatarChuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent bb2f4592
...@@ -3049,7 +3049,7 @@ int sdhci_add_host(struct sdhci_host *host) ...@@ -3049,7 +3049,7 @@ int sdhci_add_host(struct sdhci_host *host)
*/ */
max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT); max_current_caps = sdhci_readl(host, SDHCI_MAX_CURRENT);
if (!max_current_caps && !IS_ERR(mmc->supply.vmmc)) { 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) { if (curr > 0) {
/* convert to SDHCI_MAX_CURRENT format */ /* convert to SDHCI_MAX_CURRENT format */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment