* [PATCH] mfd: mc13xxx: Remove redundant checks
@ 2013-12-07 9:00 Alexander Shiyan
2013-12-09 9:42 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2013-12-07 9:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Samuel Ortiz, Lee Jones, Alexander Shiyan
Checking for maximal register is already provided by regmap API,
so remove redundant checks.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/mfd/mc13xxx-core.c | 5 +----
1 file changed, 1 insertion(+), 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);
--
1.8.3.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: mc13xxx: Remove redundant checks
2013-12-07 9:00 [PATCH] mfd: mc13xxx: Remove redundant checks Alexander Shiyan
@ 2013-12-09 9:42 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2013-12-09 9:42 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: linux-kernel, Samuel Ortiz
> Checking for maximal register is already provided by regmap API,
> so remove redundant checks.
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
> drivers/mfd/mc13xxx-core.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Applied, thanks.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-09 9:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-07 9:00 [PATCH] mfd: mc13xxx: Remove redundant checks Alexander Shiyan
2013-12-09 9:42 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®