diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2013-12-10 10:09:42 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-11 22:47:45 +0000 |
commit | 79b53d199b83a44811cd57091751ef122351ae85 (patch) | |
tree | 045219e3a218c67574b66787fc974497e956784f /drivers/regulator | |
parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) |
regulator: s5m8767: Define symbol for buck control mask
Replace hard-coded value for mask used in BUCKX_CTRL registers (for
BUCKX_EN field) with a symbol. This also removes two local variables.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/s5m8767.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index cbf91e25cf7..ef4da4442fa 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -217,7 +217,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev *rdev) { struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); int ret, reg; - int mask = 0xc0, enable_ctrl; + int enable_ctrl; unsigned int val; ret = s5m8767_get_register(rdev, ®, &enable_ctrl); @@ -230,27 +230,28 @@ static int s5m8767_reg_is_enabled(struct regulator_dev *rdev) if (ret) return ret; - return (val & mask) == enable_ctrl; + return (val & S5M8767_ENCTRL_MASK) == enable_ctrl; } static int s5m8767_reg_enable(struct regulator_dev *rdev) { struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); int ret, reg; - int mask = 0xc0, enable_ctrl; + int enable_ctrl; ret = s5m8767_get_register(rdev, ®, &enable_ctrl); if (ret) return ret; - return sec_reg_update(s5m8767->iodev, reg, enable_ctrl, mask); + return sec_reg_update(s5m8767->iodev, reg, enable_ctrl, + S5M8767_ENCTRL_MASK); } static int s5m8767_reg_disable(struct regulator_dev *rdev) { struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); int ret, reg; - int mask = 0xc0, enable_ctrl; + int mask = S5M8767_ENCTRL_MASK, enable_ctrl; ret = s5m8767_get_register(rdev, ®, &enable_ctrl); if (ret) |