• Takashi Iwai's avatar
    ALSA: Use priority list for managing device list · 289ca025
    Takashi Iwai authored
    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: default avatarTakashi Iwai <tiwai@suse.de>
    289ca025
core.h 14.7 KB