Skip to contentSkip to conversation

ASoC: Remove bogus check for register validity in debugfs write

PATCH In review Mark Brown 2 participants 2 messages Mar 16, 2011 – Mar 18, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Remove bogus check for register validity in debugfs write

Since not all registers need to be cached and the cache is entirely optional anyway we shouldn't be checking that a register is in the cached range. If the register is invalid then the actual I/O code can determine that and report an error.

Similarly, the step size can and should be enforced by the lower level code if it's important.

---
 sound/soc/soc-core.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/soc-core.c +0 -2
index 17efacd..4dda589 100644
@@ -259,8 +259,6 @@ static ssize_t codec_reg_write_file(struct file *file,
 	while (*start == ' ')
 		start++;
 	reg = simple_strtoul(start, &start, 16);
-	if ((reg >= codec->driver->reg_cache_size) || (reg % step))
-		return -EINVAL;
 	while (*start == ' ')
 		start++;
 	if (strict_strtoul(start, 16, &value))
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Mark Brown

Since not all registers need to be cached and the cache is entirely optional anyway we shouldn't be checking that a register is in the cached range. If the register is invalid then the actual I/O code can determine that and report an error.

Similarly, the step size can and should be enforced by the lower level code if it's important.