All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 07/11] ALSA: i2c: Clean up with new procfs helpers
Date: Mon,  4 Feb 2019 16:20:32 +0100	[thread overview]
Message-ID: <20190204152036.14102-8-tiwai@suse.de> (raw)
In-Reply-To: <20190204152036.14102-1-tiwai@suse.de>

Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/i2c/other/ak4113.c      | 5 ++---
 sound/i2c/other/ak4114.c      | 5 ++---
 sound/i2c/other/ak4xxx-adda.c | 8 +-------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c
index 4099e6062d3c..573599d0378d 100644
--- a/sound/i2c/other/ak4113.c
+++ b/sound/i2c/other/ak4113.c
@@ -492,9 +492,8 @@ static void snd_ak4113_proc_regs_read(struct snd_info_entry *entry,
 
 static void snd_ak4113_proc_init(struct ak4113 *ak4113)
 {
-	struct snd_info_entry *entry;
-	if (!snd_card_proc_new(ak4113->card, "ak4113", &entry))
-		snd_info_set_text_ops(entry, ak4113, snd_ak4113_proc_regs_read);
+	snd_card_ro_proc_new(ak4113->card, "ak4113", ak4113,
+			     snd_ak4113_proc_regs_read);
 }
 
 int snd_ak4113_build(struct ak4113 *ak4113,
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index 7fb1aeb46915..76afb975782d 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -465,9 +465,8 @@ static void snd_ak4114_proc_regs_read(struct snd_info_entry *entry,
 
 static void snd_ak4114_proc_init(struct ak4114 *ak4114)
 {
-	struct snd_info_entry *entry;
-	if (!snd_card_proc_new(ak4114->card, "ak4114", &entry))
-		snd_info_set_text_ops(entry, ak4114, snd_ak4114_proc_regs_read);
+	snd_card_ro_proc_new(ak4114->card, "ak4114", ak4114,
+			     snd_ak4114_proc_regs_read);
 }
 
 int snd_ak4114_build(struct ak4114 *ak4114,
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c
index 7f2761a2e7c8..62a6c5fa96b5 100644
--- a/sound/i2c/other/ak4xxx-adda.c
+++ b/sound/i2c/other/ak4xxx-adda.c
@@ -875,13 +875,7 @@ static void proc_regs_read(struct snd_info_entry *entry,
 
 static int proc_init(struct snd_akm4xxx *ak)
 {
-	struct snd_info_entry *entry;
-	int err;
-	err = snd_card_proc_new(ak->card, ak->name, &entry);
-	if (err < 0)
-		return err;
-	snd_info_set_text_ops(entry, ak, proc_regs_read);
-	return 0;
+	return snd_card_ro_proc_new(ak->card, ak->name, ak, proc_regs_read);
 }
 
 int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak)
-- 
2.16.4

  parent reply	other threads:[~2019-02-04 15:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 15:20 [PATCH 00/11] ALSA: procfs cleanups Takashi Iwai
2019-02-04 15:20 ` [PATCH 01/11] ALSA: pcm: Remove superfluous snd_info_register() calls Takashi Iwai
2019-02-04 15:20 ` [PATCH 02/11] ALSA: compress: " Takashi Iwai
2019-02-04 15:20 ` [PATCH 03/11] ALSA: pci: " Takashi Iwai
2019-02-04 15:20 ` [PATCH 04/11] ALSA: info: Add standard helpers for card proc file entries Takashi Iwai
2019-02-04 15:20 ` [PATCH 05/11] ALSA: drivers: Clean up with new procfs helpers Takashi Iwai
2019-02-04 15:20 ` [PATCH 06/11] ALSA: isa: " Takashi Iwai
2019-02-04 15:20 ` Takashi Iwai [this message]
2019-02-04 15:20 ` [PATCH 08/11] ALSA: pci: " Takashi Iwai
2019-02-04 15:20 ` [PATCH 09/11] ALSA: pcmcia: " Takashi Iwai
2019-02-04 15:20 ` [PATCH 10/11] ALSA: sparc: " Takashi Iwai
2019-02-04 15:20 ` [PATCH 11/11] ALSA: usb: " Takashi Iwai
2019-02-04 18:40 ` [PATCH 00/11] ALSA: procfs cleanups Jaroslav Kysela
2019-02-05 15:58 ` Takashi Iwai

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=20190204152036.14102-8-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.