aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-01-28 22:15:31 +0300
committerMark Brown <broonie@kernel.org>2015-01-28 19:43:43 +0000
commita412ec27957c9dc216b19d638c808d7ddfa2debd (patch)
tree55550b9e75530de0608f10a959767c508d9ee0b6 /drivers/regulator
parentLinux 3.19-rc1 (diff)
downloadlinux-dev-a412ec27957c9dc216b19d638c808d7ddfa2debd.tar.xz
linux-dev-a412ec27957c9dc216b19d638c808d7ddfa2debd.zip
regulator: qcom-rpm: signedness bug in probe()
"force_mode" is a u32 so it is never "< 0", but because of type promotion then comparing "== -1" will do what we want. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/qcom_rpm-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
index 8364ff331a81..3ab65c62fdd5 100644
--- a/drivers/regulator/qcom_rpm-regulator.c
+++ b/drivers/regulator/qcom_rpm-regulator.c
@@ -768,7 +768,7 @@ static int rpm_reg_probe(struct platform_device *pdev)
break;
}
- if (force_mode < 0) {
+ if (force_mode == -1) {
dev_err(&pdev->dev, "invalid force mode\n");
return -EINVAL;
}