From: Axel Lin Date: Mon, 25 Oct 2010 23:55:54 +0000 (+0800) Subject: regulator: max8952 - fix max8952_set_voltage X-Git-Tag: firefly_0821_release~7613^2~3579^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ec10b0e94ebe7de3b301d60e6f7f4a12d3d280c6;p=firefly-linux-kernel-4.4.55.git regulator: max8952 - fix max8952_set_voltage In current implementation, vid is declared as u8, then "vid == -1" is always false, and "vid >= 0" is always true. Thus change it to s8. Signed-off-by: Axel Lin Acked-by: Mark Brown Acked-by: Kyungmin Park Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index 7d6aacf5c493..0d5dda4fd911 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -136,7 +136,7 @@ static int max8952_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV) { struct max8952_data *max8952 = rdev_get_drvdata(rdev); - u8 vid = -1, i; + s8 vid = -1, i; if (!gpio_is_valid(max8952->pdata->gpio_vid0) || !gpio_is_valid(max8952->pdata->gpio_vid0)) {