mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-28 20:37:27 +00:00
mmc: sdhci: fix IS_ERR() checking of regulator_get()
There are two problems here: The check for vmmc was printing an unnecessary pr_info() when host->vmmc is NULL. The intent of the check for vqmmc was to only remove UHS if we have a regulator that doesn't support the required voltage, but since IS_ERR() doesn't catch NULL, we were actually removing UHS modes if vqmmc isn't present at all -- since it isn't present for most users, this breaks UHS for them. This patch fixes that UHS regression in 3.7-rc1. Signed-off-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: Bin Wang <binw@marvell.com> Reviewed-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
parent
ee3298a2b6
commit
657d59823c
@ -2849,9 +2849,12 @@ int sdhci_add_host(struct sdhci_host *host)
|
|||||||
|
|
||||||
/* If vqmmc regulator and no 1.8V signalling, then there's no UHS */
|
/* If vqmmc regulator and no 1.8V signalling, then there's no UHS */
|
||||||
host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc");
|
host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc");
|
||||||
if (IS_ERR(host->vqmmc)) {
|
if (IS_ERR_OR_NULL(host->vqmmc)) {
|
||||||
pr_info("%s: no vqmmc regulator found\n", mmc_hostname(mmc));
|
if (PTR_ERR(host->vqmmc) < 0) {
|
||||||
host->vqmmc = NULL;
|
pr_info("%s: no vqmmc regulator found\n",
|
||||||
|
mmc_hostname(mmc));
|
||||||
|
host->vqmmc = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (regulator_is_supported_voltage(host->vqmmc, 1800000, 1800000))
|
else if (regulator_is_supported_voltage(host->vqmmc, 1800000, 1800000))
|
||||||
regulator_enable(host->vqmmc);
|
regulator_enable(host->vqmmc);
|
||||||
@ -2907,9 +2910,12 @@ int sdhci_add_host(struct sdhci_host *host)
|
|||||||
ocr_avail = 0;
|
ocr_avail = 0;
|
||||||
|
|
||||||
host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
|
host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
|
||||||
if (IS_ERR(host->vmmc)) {
|
if (IS_ERR_OR_NULL(host->vmmc)) {
|
||||||
pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
|
if (PTR_ERR(host->vmmc) < 0) {
|
||||||
host->vmmc = NULL;
|
pr_info("%s: no vmmc regulator found\n",
|
||||||
|
mmc_hostname(mmc));
|
||||||
|
host->vmmc = NULL;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
regulator_enable(host->vmmc);
|
regulator_enable(host->vmmc);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user