aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-12-07 04:00:43 -0500
committerLee Jones <lee.jones@linaro.org>2014-01-21 03:28:02 -0500
commit328fe79cac65331cbf22c8eefcb2a1f9164974ac (patch)
treee342f3c8e80e856c05d8d42024c3fd9f4bcf7399 /drivers/mfd
parent844a4f0d8a5ae075e06b6a673bbc0596510046df (diff)
mfd: mc13xxx: Remove redundant checks
Checking for maximal register is already provided by regmap API, so remove redundant checks. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mc13xxx-core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index dbbf8ee3f592..b0c7cb04af85 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -158,9 +158,6 @@ int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val)
158{ 158{
159 int ret; 159 int ret;
160 160
161 if (offset > MC13XXX_NUMREGS)
162 return -EINVAL;
163
164 ret = regmap_read(mc13xxx->regmap, offset, val); 161 ret = regmap_read(mc13xxx->regmap, offset, val);
165 dev_vdbg(mc13xxx->dev, "[0x%02x] -> 0x%06x\n", offset, *val); 162 dev_vdbg(mc13xxx->dev, "[0x%02x] -> 0x%06x\n", offset, *val);
166 163
@@ -172,7 +169,7 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val)
172{ 169{
173 dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x\n", offset, val); 170 dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x\n", offset, val);
174 171
175 if (offset > MC13XXX_NUMREGS || val > 0xffffff) 172 if (val >= BIT(24))
176 return -EINVAL; 173 return -EINVAL;
177 174
178 return regmap_write(mc13xxx->regmap, offset, val); 175 return regmap_write(mc13xxx->regmap, offset, val);