ALSA: Use priority list for managing device list
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 Jan 2014 14:53:35 +0000 (15:53 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 25 Feb 2014 11:12:51 +0000 (12:12 +0100)
commit289ca025ee1d78223e3368801fc2b984e5efbfc7
tree0fbd1be93a83c459e7c053d4959fe149ec3f1785
parent71e2e1c147e653ee4e861b8b5dc0ae5c394870d2
ALSA: Use priority list for managing device list

Basically, the device type specifies the priority of the device to be
registered / freed, too.  However, the priority value isn't well
utilized but only it's checked as a group.  This results in
inconsistent register and free order (where each of them should be in
reversed direction).

This patch simplifies the device list management code by simply
inserting a list entry at creation time in an incremental order for
the priority value.  Since we can just follow the link for register,
disconnect and free calls, we don't have to specify the group; so the
whole enum definitions are also simplified as well.

The visible change to outside is that the priorities of some object
types are revisited.  For example, now the SNDRV_DEV_LOWLEVEL object
is registered before others (control, PCM, etc) and, in return,
released after others.  Similarly, SNDRV_DEV_CODEC is in a lower
priority than SNDRV_DEV_BUS for ensuring the dependency.

Also, the unused SNDRV_DEV_TOPLEVEL, SNDRV_DEV_LOWLEVEL_PRE and
SNDRV_DEV_LOWLEVEL_NORMAL are removed as a cleanup.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/core.h
sound/core/device.c
sound/core/init.c
This page took 0.027181 seconds and 5 git commands to generate.