diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-12-07 13:00:43 +0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-01-21 08:28:02 +0000 |
commit | 328fe79cac65331cbf22c8eefcb2a1f9164974ac (patch) | |
tree | e342f3c8e80e856c05d8d42024c3fd9f4bcf7399 /drivers/mfd | |
parent | 844a4f0d8a5ae075e06b6a673bbc0596510046df (diff) | |
download | op-kernel-dev-328fe79cac65331cbf22c8eefcb2a1f9164974ac.zip op-kernel-dev-328fe79cac65331cbf22c8eefcb2a1f9164974ac.tar.gz |
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.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index dbbf8ee..b0c7cb0 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) { int ret; - if (offset > MC13XXX_NUMREGS) - return -EINVAL; - ret = regmap_read(mc13xxx->regmap, 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) { dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x\n", offset, val); - if (offset > MC13XXX_NUMREGS || val > 0xffffff) + if (val >= BIT(24)) return -EINVAL; return regmap_write(mc13xxx->regmap, offset, val); |