mfd: mc13xxx: Remove redundant checks
authorAlexander Shiyan <shc_work@mail.ru>
Sat, 7 Dec 2013 09:00:43 +0000 (13:00 +0400)
committerLee Jones <lee.jones@linaro.org>
Tue, 21 Jan 2014 08:28:02 +0000 (08:28 +0000)
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>
drivers/mfd/mc13xxx-core.c

index dbbf8ee3f592369fdd5aa968148e7aa307246580..b0c7cb04af8538f8a0d1903ac24128cae4fff78e 100644 (file)
@@ -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);