From: Elaine Zhang Date: Mon, 9 May 2016 09:46:14 +0000 (+0800) Subject: regulator: rockchip: lp8752: fix up the compile warning X-Git-Tag: firefly_0821_release~2678 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fb1738eb002df3ba8c5dbedd1c96f2c65860720e;p=firefly-linux-kernel-4.4.55.git regulator: rockchip: lp8752: fix up the compile warning fix up the warning: drivers/regulator/lp8752.c: In function 'lp8752_buck_set_mode': drivers/regulator/lp8752.c:93:2: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] Change-Id: Iee9f69791bbcea2e6b3a16713b76e93cfc0a2b67 Signed-off-by: Elaine Zhang --- diff --git a/drivers/regulator/lp8752.c b/drivers/regulator/lp8752.c index 6222f72b6cf2..0062dee31a59 100644 --- a/drivers/regulator/lp8752.c +++ b/drivers/regulator/lp8752.c @@ -81,12 +81,16 @@ static int lp8752_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) ret = regmap_update_bits(pchip->regmap, rdev->desc->enable_reg, msk, 0x1); + break; case REGULATOR_MODE_NORMAL: /* automatic pwm/pfm mode */ ret = regmap_update_bits(pchip->regmap, rdev->desc->enable_reg, msk, 0x0); + break; default: + dev_err(pchip->dev, "error:lp8752 only support auto and pwm mode\n"); + ret = -EINVAL; break; }