aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fan53555.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2014-02-18 05:41:04 -0500
committerMark Brown <broonie@linaro.org>2014-02-19 11:30:08 -0500
commit145fe1e1d533943fc93da42d6f2e13aba919776e (patch)
tree613756bf3315371f03c4d94fc1ebd45444bf0712 /drivers/regulator/fan53555.c
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
regulator: fan53555: Do not hardcode return values
Propagate the error values returned by the function instead. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/fan53555.c')
-rw-r--r--drivers/regulator/fan53555.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 7ca3d9e3b0fe..a10df7d150cc 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -90,11 +90,11 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
90 return 0; 90 return 0;
91 ret = regulator_map_voltage_linear(rdev, uV, uV); 91 ret = regulator_map_voltage_linear(rdev, uV, uV);
92 if (ret < 0) 92 if (ret < 0)
93 return -EINVAL; 93 return ret;
94 ret = regmap_update_bits(di->regmap, di->sleep_reg, 94 ret = regmap_update_bits(di->regmap, di->sleep_reg,
95 VSEL_NSEL_MASK, ret); 95 VSEL_NSEL_MASK, ret);
96 if (ret < 0) 96 if (ret < 0)
97 return -EINVAL; 97 return ret;
98 /* Cache the sleep voltage setting. 98 /* Cache the sleep voltage setting.
99 * Might not be the real voltage which is rounded */ 99 * Might not be the real voltage which is rounded */
100 di->sleep_vol_cache = uV; 100 di->sleep_vol_cache = uV;
@@ -260,14 +260,14 @@ static int fan53555_regulator_probe(struct i2c_client *client,
260 ret = regmap_read(di->regmap, FAN53555_ID1, &val); 260 ret = regmap_read(di->regmap, FAN53555_ID1, &val);
261 if (ret < 0) { 261 if (ret < 0) {
262 dev_err(&client->dev, "Failed to get chip ID!\n"); 262 dev_err(&client->dev, "Failed to get chip ID!\n");
263 return -ENODEV; 263 return ret;
264 } 264 }
265 di->chip_id = val & DIE_ID; 265 di->chip_id = val & DIE_ID;
266 /* Get chip revision */ 266 /* Get chip revision */
267 ret = regmap_read(di->regmap, FAN53555_ID2, &val); 267 ret = regmap_read(di->regmap, FAN53555_ID2, &val);
268 if (ret < 0) { 268 if (ret < 0) {
269 dev_err(&client->dev, "Failed to get chip Rev!\n"); 269 dev_err(&client->dev, "Failed to get chip Rev!\n");
270 return -ENODEV; 270 return ret;
271 } 271 }
272 di->chip_rev = val & DIE_REV; 272 di->chip_rev = val & DIE_REV;
273 dev_info(&client->dev, "FAN53555 Option[%d] Rev[%d] Detected!\n", 273 dev_info(&client->dev, "FAN53555 Option[%d] Rev[%d] Detected!\n",