All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] ALSA: hda/realtek: Use snd_ctl_rename() to rename a control
Date: Thu, 20 Oct 2022 22:46:23 +0200	[thread overview]
Message-ID: <37496bd80f91f373268148f877fd735917d97287.1666296963.git.maciej.szmigiero@oracle.com> (raw)
In-Reply-To: <cover.1666296963.git.maciej.szmigiero@oracle.com>

From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>

With the recent addition of hashed controls lookup it's not enough to just
update the control name field, the hash entries for the modified control
have to be updated too.

snd_ctl_rename() takes care of that, so use it instead of directly
modifying the control name.

Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups")
Cc: stable@vger.kernel.org
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
---
 sound/pci/hda/patch_realtek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 79acd2a2caf20..9945861f02efa 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2142,7 +2142,7 @@ static void rename_ctl(struct hda_codec *codec, const char *oldname,
 
 	kctl = snd_hda_find_mixer_ctl(codec, oldname);
 	if (kctl)
-		strcpy(kctl->id.name, newname);
+		snd_ctl_rename(codec->card, kctl, newname);
 }
 
 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,

  parent reply	other threads:[~2022-10-20 20:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 20:46 [PATCH 0/6] Fix direct renaming of hashed controls Maciej S. Szmigiero
2022-10-20 20:46 ` [PATCH 1/6] ALSA: control: add snd_ctl_rename() Maciej S. Szmigiero
2022-10-20 20:46 ` [PATCH 2/6] ALSA: usb-audio: Use snd_ctl_rename() to rename a control Maciej S. Szmigiero
2022-10-20 20:46 ` Maciej S. Szmigiero [this message]
2022-10-20 20:46 ` [PATCH 4/6] ALSA: emu10k1: " Maciej S. Szmigiero
2022-10-20 20:46 ` [PATCH 5/6] ALSA: ca0106: " Maciej S. Szmigiero
2022-10-20 20:46 ` [PATCH 6/6] ALSA: ac97: " Maciej S. Szmigiero
2022-10-21  6:18 ` [PATCH 0/6] Fix direct renaming of hashed controls Takashi Iwai
2022-10-21  6:18   ` 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=37496bd80f91f373268148f877fd735917d97287.1666296963.git.maciej.szmigiero@oracle.com \
    --to=mail@maciej.szmigiero.name \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 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.