File: last.c

package info (click to toggle)
linux 6.10.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,623,840 kB
  • sloc: ansic: 25,279,581; asm: 268,818; sh: 131,442; python: 60,803; makefile: 54,212; perl: 37,987; xml: 18,136; cpp: 5,677; yacc: 4,900; lex: 2,917; awk: 1,158; sed: 28; ruby: 25
file content (29 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (48)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Advanced Linux Sound Architecture
 *  Copyright (c) by Jaroslav Kysela <[email protected]>
 */

#include <linux/init.h>
#include <sound/core.h>

static int __init alsa_sound_last_init(void)
{
	struct snd_card *card;
	int idx, ok = 0;
	
	printk(KERN_INFO "ALSA device list:\n");
	for (idx = 0; idx < SNDRV_CARDS; idx  ) {
		card = snd_card_ref(idx);
		if (card) {
			printk(KERN_INFO "  #%i: %s\n", idx, card->longname);
			snd_card_unref(card);
			ok  ;
		}
	}
	if (ok == 0)
		printk(KERN_INFO "  No soundcards found.\n");
	return 0;
}

late_initcall_sync(alsa_sound_last_init);