aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-06 11:04:57 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-10 06:41:07 -0500
commit0d51a9cbb6c1275cc0f3840c36f8b7840a438c59 (patch)
tree39975b55dea716b91635d25e21b6fb0eb9b40d44
parent9c6df19e55799d23863eb414b0ee850c4fd3a174 (diff)
ASoC: Taint the kernel if debugfs is used to write directly to CODECs
Since direct register writes may confuse the drivers and are supposed to be used only in diagnostic situations discourage their use in production by tainting the kernel when we do a write. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--sound/soc/soc-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index bac7291b6ff6..96bf381683f7 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file,
209 start++; 209 start++;
210 if (strict_strtoul(start, 16, &value)) 210 if (strict_strtoul(start, 16, &value))
211 return -EINVAL; 211 return -EINVAL;
212
213 /* Userspace has been fiddling around behind the kernel's back */
214 add_taint(TAINT_USER);
215
212 snd_soc_write(codec, reg, value); 216 snd_soc_write(codec, reg, value);
213 return buf_size; 217 return buf_size;
214} 218}