diff options
author | Liam Girdwood <lrg@ti.com> | 2012-04-27 11:33:46 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-27 18:38:47 +0100 |
commit | f57b8488bc39f7674cbadf4e2db05a7db8ffa660 (patch) | |
tree | 97cae937a5a6646542ceacded9f70ab44ce4d292 /sound | |
parent | 604bb229b5269747e5763efe05726b080276d77f (diff) | |
download | op-kernel-dev-f57b8488bc39f7674cbadf4e2db05a7db8ffa660.zip op-kernel-dev-f57b8488bc39f7674cbadf4e2db05a7db8ffa660.tar.gz |
ASoC: dpcm: Fixup debugFS for DPCM state.
Remove writable debugFS permission, use simple_open() and
fix indentation.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-pcm.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 4e3be82..c0b394f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2241,12 +2241,6 @@ static char *dpcm_state_string(enum snd_soc_dpcm_state state) return "unknown"; } -static int dpcm_state_open_file(struct inode *inode, struct file *file) -{ - file->private_data = inode->i_private; - return 0; -} - static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe, int stream, char *buf, size_t size) { @@ -2324,15 +2318,14 @@ static ssize_t dpcm_state_read_file(struct file *file, char __user *user_buf, offset += dpcm_show_state(fe, SNDRV_PCM_STREAM_CAPTURE, buf + offset, out_count - offset); - ret = simple_read_from_buffer(user_buf, count, ppos, buf, offset); - - kfree(buf); + ret = simple_read_from_buffer(user_buf, count, ppos, buf, offset); - return ret; + kfree(buf); + return ret; } static const struct file_operations dpcm_state_fops = { - .open = dpcm_state_open_file, + .open = simple_open, .read = dpcm_state_read_file, .llseek = default_llseek, }; @@ -2348,7 +2341,7 @@ int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd) return -EINVAL; } - rtd->debugfs_dpcm_state = debugfs_create_file("state", 0644, + rtd->debugfs_dpcm_state = debugfs_create_file("state", 0444, rtd->debugfs_dpcm_root, rtd, &dpcm_state_fops); |