aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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);