Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ALSA] clean up device types symbols

Modules: ALSA Core,ALSA Minor Numbers

Remove the unused and undefined symbols SNDRV_DEVICE_TYPE_{MIXER,
PCM_PLOOP,PCM_CLOOP}, and introduce a new symbol SNDRV_MINOR_GLOBAL
for non-card-specific devices like the sequencer or the timer.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

authored by

Clemens Ladisch and committed by
Jaroslav Kysela
3939e714 fc58422a

+5 -7
+3 -5
include/sound/minors.h
··· 27 27 #define SNDRV_MINOR(card, dev) (((card) << 5) | (dev)) 28 28 29 29 #define SNDRV_MINOR_CONTROL 0 /* 0 - 0 */ 30 - #define SNDRV_MINOR_SEQUENCER 1 31 - #define SNDRV_MINOR_TIMER (1+32) 30 + #define SNDRV_MINOR_GLOBAL 1 /* 1 */ 31 + #define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) 32 + #define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) 32 33 #define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ 33 34 #define SNDRV_MINOR_HWDEPS 4 34 35 #define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ ··· 40 39 41 40 #define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL 42 41 #define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP 43 - #define SNDRV_DEVICE_TYPE_MIXER SNDRV_MINOR_MIXER 44 42 #define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI 45 43 #define SNDRV_DEVICE_TYPE_PCM_PLAYBACK SNDRV_MINOR_PCM_PLAYBACK 46 - #define SNDRV_DEVICE_TYPE_PCM_PLOOP SNDRV_MINOR_PCM_PLOOP 47 44 #define SNDRV_DEVICE_TYPE_PCM_CAPTURE SNDRV_MINOR_PCM_CAPTURE 48 - #define SNDRV_DEVICE_TYPE_PCM_CLOOP SNDRV_MINOR_PCM_CLOOP 49 45 #define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER 50 46 #define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER 51 47
+2 -2
sound/core/sound.c
··· 130 130 struct file_operations *old_fops; 131 131 int err = 0; 132 132 133 - if (dev != SNDRV_MINOR_SEQUENCER && dev != SNDRV_MINOR_TIMER) { 133 + if (dev != SNDRV_MINOR_GLOBAL) { 134 134 if (snd_cards[card] == NULL) { 135 135 #ifdef CONFIG_KMOD 136 136 snd_request_card(card); ··· 287 287 for (card = 0; card < SNDRV_CARDS; card++) { 288 288 list_for_each(list, &snd_minors_hash[card]) { 289 289 mptr = list_entry(list, snd_minor_t, list); 290 - if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_SEQUENCER) { 290 + if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) { 291 291 if ((device = mptr->device) >= 0) 292 292 snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment); 293 293 else