From: Mark Brown Date: Mon, 3 Jun 2019 17:38:15 +0000 (+0100) Subject: Merge branch 'asoc-5.2' into asoc-5.3 X-Git-Tag: v5.15~5427^2~39^2~400 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a529819d8876fd469f58e630ed015c4a4620ee75;p=platform%2Fkernel%2Flinux-starfive.git Merge branch 'asoc-5.2' into asoc-5.3 --- a529819d8876fd469f58e630ed015c4a4620ee75 diff --cc sound/pci/hda/hda_codec.c index b20eb7f,6cdec64..fcdf2cd --- 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; }