Skip to content

Commit 1dcc434

Browse files
AxelLinLiam Girdwood
authored andcommitted
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. Signed-off-by: Axel Lin <[email protected]> Cc: Mark Brown <[email protected]> Cc: Liam Girdwood <[email protected]> Acked-by: Sascha Hauer <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Liam Girdwood <[email protected]>
1 parent 9f79e9d commit 1dcc434

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/regulator/mc13783-regulator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ static int mc13783_fixed_regulator_set_voltage(struct regulator_dev *rdev,
440440
dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
441441
__func__, id, min_uV, max_uV);
442442

443-
if (min_uV > mc13783_regulators[id].voltages[0] &&
444-
max_uV < mc13783_regulators[id].voltages[0])
443+
if (min_uV >= mc13783_regulators[id].voltages[0] &&
444+
max_uV <= mc13783_regulators[id].voltages[0])
445445
return 0;
446446
else
447447
return -EINVAL;
@@ -649,6 +649,6 @@ static void __exit mc13783_regulator_exit(void)
649649
module_exit(mc13783_regulator_exit);
650650

651651
MODULE_LICENSE("GPL v2");
652-
MODULE_AUTHOR("Sascha Hauer <[email protected]");
652+
MODULE_AUTHOR("Sascha Hauer <[email protected]>");
653653
MODULE_DESCRIPTION("Regulator Driver for Freescale MC13783 PMIC");
654654
MODULE_ALIAS("platform:mc13783-regulator");

0 commit comments

Comments
 (0)