• Takashi Iwai's avatar
    ALSA: control: Use guard() for locking · 471be437
    Takashi Iwai authored
    We can simplify the code gracefully with new guard() macro and co for
    automatic cleanup of locks.
    
    The lops calls under multiple rwsems are factored out as a simple
    macro, so that it can be called easily from snd_ctl_dev_register()
    and snd_ctl_dev_disconnect().
    
    There are a few remaining explicit rwsem and spinlock calls, and those
    are the places where the lock downgrade happens or where the temporary
    unlock/relocking happens -- which guard() doens't cover well yet.
    
    Only the code refactoring, and no functional changes.
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    Link: https://lore.kernel.org/r/20240227085306.9764-9-tiwai@suse.de
    471be437
control_compat.c 12.1 KB