diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-04-30 09:23:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:26 -0400 |
commit | 7a9d56f6a459472bc4383aeb85612d72e79d1818 (patch) | |
tree | 4ec671fe098817eb3cad24f1b04604a8ebb56dfd /sound | |
parent | aa5ed63e96656bb246a9439e06c7b67d455a5aa1 (diff) |
Driver Core: sound: add nodename for sound drivers
This adds support to the sound core to report the proper device name to
userspace for their devices.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/sound_core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/sound_core.c b/sound/sound_core.c index 2b302bbffe73..12522e6913d9 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -27,6 +27,11 @@ MODULE_DESCRIPTION("Core sound module"); | |||
27 | MODULE_AUTHOR("Alan Cox"); | 27 | MODULE_AUTHOR("Alan Cox"); |
28 | MODULE_LICENSE("GPL"); | 28 | MODULE_LICENSE("GPL"); |
29 | 29 | ||
30 | static char *sound_nodename(struct device *dev) | ||
31 | { | ||
32 | return kasprintf(GFP_KERNEL, "snd/%s", dev_name(dev)); | ||
33 | } | ||
34 | |||
30 | static int __init init_soundcore(void) | 35 | static int __init init_soundcore(void) |
31 | { | 36 | { |
32 | int rc; | 37 | int rc; |
@@ -41,6 +46,8 @@ static int __init init_soundcore(void) | |||
41 | return PTR_ERR(sound_class); | 46 | return PTR_ERR(sound_class); |
42 | } | 47 | } |
43 | 48 | ||
49 | sound_class->nodename = sound_nodename; | ||
50 | |||
44 | return 0; | 51 | return 0; |
45 | } | 52 | } |
46 | 53 | ||