Commit 328fe79c authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Lee Jones

mfd: mc13xxx: Remove redundant checks

Checking for maximal register is already provided by regmap API,
so remove redundant checks.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 844a4f0d
...@@ -158,9 +158,6 @@ int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val) ...@@ -158,9 +158,6 @@ int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val)
{ {
int ret; int ret;
if (offset > MC13XXX_NUMREGS)
return -EINVAL;
ret = regmap_read(mc13xxx->regmap, offset, val); ret = regmap_read(mc13xxx->regmap, offset, val);
dev_vdbg(mc13xxx->dev, "[0x%02x] -> 0x%06x\n", offset, *val); dev_vdbg(mc13xxx->dev, "[0x%02x] -> 0x%06x\n", offset, *val);
...@@ -172,7 +169,7 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val) ...@@ -172,7 +169,7 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val)
{ {
dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x\n", offset, val); dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x\n", offset, val);
if (offset > MC13XXX_NUMREGS || val > 0xffffff) if (val >= BIT(24))
return -EINVAL; return -EINVAL;
return regmap_write(mc13xxx->regmap, offset, val); return regmap_write(mc13xxx->regmap, offset, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment