summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_bind.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-18 09:38:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-18 09:38:54 +0200
commit412a5feba414127a6c69452dfad454086867011f (patch)
treebf5934b41bff82f4ec69283d10fb1a799f42a641 /sound/pci/hda/hda_bind.c
parent5f0ac3a1dae17ec0af6b845376247d7cc948ea3d (diff)
parent519d81956ee277b4419c723adfb154603c2565ba (diff)
downloadlinux-stable-412a5feba414127a6c69452dfad454086867011f.tar.gz
linux-stable-412a5feba414127a6c69452dfad454086867011f.tar.bz2
linux-stable-412a5feba414127a6c69452dfad454086867011f.zip
Merge 5.15-rc6 into tty-next
We need the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/hda/hda_bind.c')
-rw-r--r--sound/pci/hda/hda_bind.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
index 2523b23389e9..1c8bffc3eec6 100644
--- a/sound/pci/hda/hda_bind.c
+++ b/sound/pci/hda/hda_bind.c
@@ -298,29 +298,31 @@ int snd_hda_codec_configure(struct hda_codec *codec)
{
int err;
+ if (codec->configured)
+ return 0;
+
if (is_generic_config(codec))
codec->probe_id = HDA_CODEC_ID_GENERIC;
else
codec->probe_id = 0;
- err = snd_hdac_device_register(&codec->core);
- if (err < 0)
- return err;
+ if (!device_is_registered(&codec->core.dev)) {
+ err = snd_hdac_device_register(&codec->core);
+ if (err < 0)
+ return err;
+ }
if (!codec->preset)
codec_bind_module(codec);
if (!codec->preset) {
err = codec_bind_generic(codec);
if (err < 0) {
- codec_err(codec, "Unable to bind the codec\n");
- goto error;
+ codec_dbg(codec, "Unable to bind the codec\n");
+ return err;
}
}
+ codec->configured = 1;
return 0;
-
- error:
- snd_hdac_device_unregister(&codec->core);
- return err;
}
EXPORT_SYMBOL_GPL(snd_hda_codec_configure);