diff options
author | Kevin Liu <kliu5@marvell.com> | 2012-10-17 07:04:44 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-11-07 15:02:04 -0500 |
commit | 657d59823c095e8f03e2744d765f53700331ff8f (patch) | |
tree | 33cb97164df514189cf478d4bcb7a327f2c0c856 /drivers/mmc | |
parent | ee3298a2b6832bcfeec040dabf19632b704d826a (diff) |
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f05a37747b3d..949e18c7c05d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -2849,9 +2849,12 @@ int sdhci_add_host(struct sdhci_host *host) | |||
2849 | 2849 | ||
2850 | /* If vqmmc regulator and no 1.8V signalling, then there's no UHS */ | 2850 | /* If vqmmc regulator and no 1.8V signalling, then there's no UHS */ |
2851 | host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc"); | 2851 | host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc"); |
2852 | if (IS_ERR(host->vqmmc)) { | 2852 | if (IS_ERR_OR_NULL(host->vqmmc)) { |
2853 | pr_info("%s: no vqmmc regulator found\n", mmc_hostname(mmc)); | 2853 | if (PTR_ERR(host->vqmmc) < 0) { |
2854 | host->vqmmc = NULL; | 2854 | pr_info("%s: no vqmmc regulator found\n", |
2855 | mmc_hostname(mmc)); | ||
2856 | host->vqmmc = NULL; | ||
2857 | } | ||
2855 | } | 2858 | } |
2856 | else if (regulator_is_supported_voltage(host->vqmmc, 1800000, 1800000)) | 2859 | else if (regulator_is_supported_voltage(host->vqmmc, 1800000, 1800000)) |
2857 | regulator_enable(host->vqmmc); | 2860 | regulator_enable(host->vqmmc); |
@@ -2907,9 +2910,12 @@ int sdhci_add_host(struct sdhci_host *host) | |||
2907 | ocr_avail = 0; | 2910 | ocr_avail = 0; |
2908 | 2911 | ||
2909 | host->vmmc = regulator_get(mmc_dev(mmc), "vmmc"); | 2912 | host->vmmc = regulator_get(mmc_dev(mmc), "vmmc"); |
2910 | if (IS_ERR(host->vmmc)) { | 2913 | if (IS_ERR_OR_NULL(host->vmmc)) { |
2911 | pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc)); | 2914 | if (PTR_ERR(host->vmmc) < 0) { |
2912 | host->vmmc = NULL; | 2915 | pr_info("%s: no vmmc regulator found\n", |
2916 | mmc_hostname(mmc)); | ||
2917 | host->vmmc = NULL; | ||
2918 | } | ||
2913 | } else | 2919 | } else |
2914 | regulator_enable(host->vmmc); | 2920 | regulator_enable(host->vmmc); |
2915 | 2921 | ||