diff mbox

[2/3] mmc: use regulator_can_change_voltage() instead of regulator_count_voltages() hacks

Message ID 1354629663-29091-3-git-send-email-m.szyprowski@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marek Szyprowski Dec. 4, 2012, 2:01 p.m. UTC
mmc_regulator_set_ocr() depends on the ability of regulator to change the
voltage value. When regulator cannot change its voltage output, some code is
skipped to avoid reporting false errors on some boards, which use MMC hosts
with fixed regulators (example: Samsung Goni and UniversalC210 boards).

This patch replaces a hacky workaround based on regulator_count_voltages()
value with the correct call to recently introduced
regulator_can_change_voltage() function in regulators core.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/mmc/core/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Szyprowski Feb. 1, 2013, 2:39 p.m. UTC | #1
Hello,

On 12/4/2012 3:01 PM, Marek Szyprowski wrote:
> mmc_regulator_set_ocr() depends on the ability of regulator to change the
> voltage value. When regulator cannot change its voltage output, some code is
> skipped to avoid reporting false errors on some boards, which use MMC hosts
> with fixed regulators (example: Samsung Goni and UniversalC210 boards).
>
> This patch replaces a hacky workaround based on regulator_count_voltages()
> value with the correct call to recently introduced
> regulator_can_change_voltage() function in regulators core.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Any chance to get this patch scheduled for v3.9?

> ---
>   drivers/mmc/core/core.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index aaed768..f5a0493 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1137,7 +1137,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc,
>   		 */
>   		voltage = regulator_get_voltage(supply);
>   
> -		if (regulator_count_voltages(supply) == 1)
> +		if (!regulator_can_change_voltage(supply))
>   			min_uV = max_uV = voltage;
>   
>   		if (voltage < 0)

Best regards
Chris Ball Feb. 11, 2013, 5:26 p.m. UTC | #2
Hi Marek,

On Fri, Feb 01 2013, Marek Szyprowski wrote:
> On 12/4/2012 3:01 PM, Marek Szyprowski wrote:
>> mmc_regulator_set_ocr() depends on the ability of regulator to change the
>> voltage value. When regulator cannot change its voltage output, some code is
>> skipped to avoid reporting false errors on some boards, which use MMC hosts
>> with fixed regulators (example: Samsung Goni and UniversalC210 boards).
>>
>> This patch replaces a hacky workaround based on regulator_count_voltages()
>> value with the correct call to recently introduced
>> regulator_can_change_voltage() function in regulators core.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
> Any chance to get this patch scheduled for v3.9?

Thanks, pushed to mmc-next for 3.9.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index aaed768..f5a0493 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1137,7 +1137,7 @@  int mmc_regulator_set_ocr(struct mmc_host *mmc,
 		 */
 		voltage = regulator_get_voltage(supply);
 
-		if (regulator_count_voltages(supply) == 1)
+		if (!regulator_can_change_voltage(supply))
 			min_uV = max_uV = voltage;
 
 		if (voltage < 0)