Skip to content

Commit

Permalink
Driver Core: sound: add nodename for sound drivers
Browse files Browse the repository at this point in the history
This adds support to the sound core to report the proper device name to
userspace for their devices.

Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: Jan Blunck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kaysievers authored and gregkh committed Jun 16, 2009
1 parent aa5ed63 commit 7a9d56f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sound/sound_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ MODULE_DESCRIPTION("Core sound module");
MODULE_AUTHOR("Alan Cox");
MODULE_LICENSE("GPL");

static char *sound_nodename(struct device *dev)
{
return kasprintf(GFP_KERNEL, "snd/%s", dev_name(dev));
}

static int __init init_soundcore(void)
{
int rc;
Expand All @@ -41,6 +46,8 @@ static int __init init_soundcore(void)
return PTR_ERR(sound_class);
}

sound_class->nodename = sound_nodename;

return 0;
}

Expand Down

0 comments on commit 7a9d56f

Please sign in to comment.