From: Takashi Iwai Date: Thu, 13 Jun 2019 15:33:34 +0000 (+0200) Subject: Merge tag 'asoc-fix-v5.2-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=84396d141894c52f55c1276630587862f5ced7dd;p=people%2Fjulieng%2Flinux-arm.git Merge tag 'asoc-fix-v5.2-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.2 There's an awful lot of fixes here, almost all for the newly introduced SoF DSP drivers (including a few things it turned up in shared code). This is a large and complex piece of code so it's not surprising that there have been quite a few issues here, fortunately things seem to have mostly calmed down now. Otherwise there's just a smattering of small fixes. --- 84396d141894c52f55c1276630587862f5ced7dd diff --cc sound/pci/hda/hda_codec.c index b20eb7fc83eb,6cdec64dc68a..fcdf2cd3783b --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@@ -832,15 -832,16 +832,22 @@@ static int snd_hda_codec_dev_free(struc struct hda_codec *codec = device->device_data; codec->in_freeing = 1; - snd_hdac_device_unregister(&codec->core); + /* + * snd_hda_codec_device_new() is used by legacy HDA and ASoC driver. + * We can't unregister ASoC device since it will be unregistered in + * snd_hdac_ext_bus_device_remove(). + */ + if (codec->core.type == HDA_DEV_LEGACY) + snd_hdac_device_unregister(&codec->core); codec_display_power(codec, false); - put_device(hda_codec_dev(codec)); + + /* + * In the case of ASoC HD-audio bus, the device refcount is released in + * snd_hdac_ext_bus_device_remove() explicitly. + */ + if (codec->core.type == HDA_DEV_LEGACY) + put_device(hda_codec_dev(codec)); + return 0; }