blob: f0bb98780e70315b1c9a1451486cb8c839f40ce1 [file] [log] [blame]
Thomas Gleixner1a59d1b82019-05-27 08:55:05 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Advanced Linux Sound Architecture
Jaroslav Kyselac1017a42007-10-15 09:50:19 +02004 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <linux/init.h>
8#include <sound/core.h>
9
10static int __init alsa_sound_last_init(void)
11{
Takashi Iwaif4fa9682019-04-16 18:18:47 +020012 struct snd_card *card;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 int idx, ok = 0;
14
15 printk(KERN_INFO "ALSA device list:\n");
Takashi Iwaif4fa9682019-04-16 18:18:47 +020016 for (idx = 0; idx < SNDRV_CARDS; idx++) {
17 card = snd_card_ref(idx);
18 if (card) {
19 printk(KERN_INFO " #%i: %s\n", idx, card->longname);
20 snd_card_unref(card);
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 ok++;
22 }
Takashi Iwaif4fa9682019-04-16 18:18:47 +020023 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 if (ok == 0)
25 printk(KERN_INFO " No soundcards found.\n");
26 return 0;
27}
28
Kuninori Morimoto590b4772012-04-19 00:00:27 -070029late_initcall_sync(alsa_sound_last_init);