alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>
Subject: [PATCH] ASoC: dpcm: Fixup debugFS for DPCM state.
Date: Fri, 27 Apr 2012 11:33:46 +0100	[thread overview]
Message-ID: <1335522826-22272-1-git-send-email-lrg@ti.com> (raw)

Remove writable debugFS permission, use simple_open() and
fix indentation.

Signed-off-by: Liam Girdwood <lrg@ti.com>
---
 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 ca19152..0e68d2d 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2389,12 +2389,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)
 {
@@ -2472,15 +2466,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,
 };
@@ -2496,7 +2489,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);
 
-- 
1.7.5.4

             reply	other threads:[~2012-04-27 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 10:33 Liam Girdwood [this message]
2012-04-27 17:39 ` [PATCH] ASoC: dpcm: Fixup debugFS for DPCM state Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335522826-22272-1-git-send-email-lrg@ti.com \
    --to=lrg@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).