All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 3/4] ALSA: hda - Get rid of superfluous beep->mode field
Date: Tue,  3 Jul 2012 18:03:16 +0200	[thread overview]
Message-ID: <1341331397-21182-4-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1341331397-21182-1-git-send-email-tiwai@suse.de>

It's no longer necessary since beep_mode=2 option was dropped.
It can be checked simply via codec->beep != NULL.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/hda_beep.c |   14 ++++++--------
 sound/pci/hda/hda_beep.h |    1 -
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 336b4b3..e6cf2a2 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -184,6 +184,7 @@ EXPORT_SYMBOL_HDA(snd_hda_enable_beep_device);
 int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
 {
 	struct hda_beep *beep;
+	int err;
 
 	if (!snd_hda_get_bool_hint(codec, "beep"))
 		return 0; /* disabled explicitly by hints */
@@ -201,19 +202,16 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
 
 	beep->nid = nid;
 	beep->codec = codec;
-	beep->mode = codec->beep_mode;
 	codec->beep = beep;
 
 	INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
 	mutex_init(&beep->mutex);
 
-	if (beep->mode) {
-		int err = snd_hda_do_attach(beep);
-		if (err < 0) {
-			kfree(beep);
-			codec->beep = NULL;
-			return err;
-		}
+	err = snd_hda_do_attach(beep);
+	if (err < 0) {
+		kfree(beep);
+		codec->beep = NULL;
+		return err;
 	}
 
 	return 0;
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index 30e79d1..4dc6933 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -31,7 +31,6 @@
 struct hda_beep {
 	struct input_dev *dev;
 	struct hda_codec *codec;
-	unsigned int mode;
 	char phys[32];
 	int tone;
 	hda_nid_t nid;
-- 
1.7.10.4

  parent reply	other threads:[~2012-07-03 16:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 16:03 [PATCH 0/4] ALSA: hda beep clean up Takashi Iwai
2012-07-03 16:03 ` [PATCH 1/4] ALSA: hda - Remove beep_mode=2 Takashi Iwai
2012-07-03 16:03 ` [PATCH 2/4] ALSA: hda - Move beep helper functions to hda_beep.c Takashi Iwai
2012-07-03 16:03 ` Takashi Iwai [this message]
2012-07-03 16:03 ` [PATCH 4/4] ALSA: hda - Avoid possible race of beep on/off Takashi Iwai
2012-07-03 16:31 ` [PATCH 0/4] ALSA: hda beep clean up Jaroslav Kysela
2012-07-03 20:01   ` Jaroslav Kysela
2012-07-04  5:16     ` Takashi Iwai
2012-07-04  7:43       ` Jaroslav Kysela
2012-07-04  7:46         ` 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=1341331397-21182-4-git-send-email-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.