]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda - Allocate hda_pcm objects dynamically
authorTakashi Iwai <tiwai@suse.de>
Fri, 27 Feb 2015 16:43:19 +0000 (17:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 3 Mar 2015 10:26:24 +0000 (11:26 +0100)
commitcd6a31e1925e9803c178b1bff345d3544abd72c4
tree71d5973b321c194ca5b9fd76592844eb37c4c9ed
parente8e034b86f4a2cc4bb4f18523a0ee86304b23d77
ALSA: hda - Allocate hda_pcm objects dynamically

So far, the hda_codec object kept the hda_pcm list in an array, and
the codec driver was expected to assign the array.  However, this
makes the object life cycle management harder, because the assigned
array is freed at the codec driver detach while it might be still
accessed by the opened streams.

In this patch, we allocate each hda_pcm object dynamically and manage
it as a linked list.  Each object has a kref refcount, and both the
codec driver binder and the PCM open/close touches it, so that the
object won't be freed while in use.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_generic.c
sound/pci/hda/hda_generic.h
sound/pci/hda/hda_proc.c
sound/pci/hda/patch_ca0132.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_si3054.c
sound/pci/hda/patch_via.c