Skip to contentSkip to conversation

mc13783-regulator: fix vaild voltage range checking for mc13783_fixed_regulator_set_voltage

PATCH RESEND Applied Axel Lin 3 participants 5 messages May 6, 2010 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/1 mc13783-regulator: fix vaild voltage range checking for mc13783_fixed_regulator_set_voltage

In the case of "min_uV == max_uV == mc13783_regulators[id].voltages[0]", mc13783_fixed_regulator_set_voltage should return 0 instead of -EINVAL.

This patch also adds a missing ">" character for MODULE_AUTHOR, a trivial fix.

Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
---
 drivers/regulator/mc13783-regulator.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/mc13783-regulator.c +3 -3
index ad036dd..4597d50 100644
@@ -440,8 +440,8 @@ static int mc13783_fixed_regulator_set_voltage(struct regulator_dev *rdev,
 	dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
 		__func__, id, min_uV, max_uV);
 
-	if (min_uV > mc13783_regulators[id].voltages[0] &&
-	    max_uV < mc13783_regulators[id].voltages[0])
+	if (min_uV >= mc13783_regulators[id].voltages[0] &&
+	    max_uV <= mc13783_regulators[id].voltages[0])
 		return 0;
 	else
 		return -EINVAL;
@@ -649,6 +649,6 @@ static void __exit mc13783_regulator_exit(void)
 module_exit(mc13783_regulator_exit);
 
 MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Sascha Hauer <[email protected]");
+MODULE_AUTHOR("Sascha Hauer <[email protected]>");
 MODULE_DESCRIPTION("Regulator Driver for Freescale MC13783 PMIC");
 MODULE_ALIAS("platform:mc13783-regulator");
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 12 lines · Axel Lin

In the case of "min_uV == max_uV == mc13783_regulators[id].voltages[0]", mc13783_fixed_regulator_set_voltage should return 0 instead of -EINVAL.

This patch also adds a missing ">" character for MODULE_AUTHOR, a trivial fix.

Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
---
 drivers/regulator/mc13783-regulator.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Both patches look the same. Is there any reason for the resend ?

Thanks

Liam

author
#2 lore raw

hi Liam,

2010/5/6 Liam Girdwood <[email protected]>:

Quoted 14 lines · Axel Lin
Quoted 12 lines

In the case of "min_uV == max_uV == mc13783_regulators[id].voltages[0]", mc13783_fixed_regulator_set_voltage should return 0 instead of -EINVAL.

This patch also adds a missing ">" character for MODULE_AUTHOR, a trivial fix.

Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>

---
 drivers/regulator/mc13783-regulator.c |    6 +++---

 1 files changed, 3 insertions(+), 3 deletions(-)
Quoted 1 line

Both patches look the same. Is there any reason for the resend ?

I just found my mail client make the first patch not able to be cleanly applied by git-am.
The resend one fix it, and should be cleanly applied by git-am command.

Regards,
Axel

Quoted 6 lines

Thanks

Liam

Acked-by on v1 1/1
#3 lore raw
In reply to Axel Lin
Quoted 8 lines · Axel Lin

In the case of "min_uV == max_uV == mc13783_regulators[id].voltages[0]", mc13783_fixed_regulator_set_voltage should return 0 instead of -EINVAL.

This patch also adds a missing ">" character for MODULE_AUTHOR, a trivial fix.

Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>

Better to send two patches for two separate fixes, especially where there's no overlap in the code.

#4 lore raw
In reply to Axel Lin
Quoted 12 lines · Axel Lin

In the case of "min_uV == max_uV == mc13783_regulators[id].voltages[0]", mc13783_fixed_regulator_set_voltage should return 0 instead of -EINVAL.

This patch also adds a missing ">" character for MODULE_AUTHOR, a trivial fix.

Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
---
 drivers/regulator/mc13783-regulator.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Applied.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk