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 | 8a8bdcc7533b104d789d9bb3ed90da9352515e21 (patch) | |
tree | d7ce8312c39b5246b93281cda0c8c3f6c637499d | |
parent | 07e9bb8eebb04c81323cbd3eabf07a3f6f05b204 (diff) |
Driver Core: dvb: add nodename for dvb drivers
This adds support to the dvb 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>
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index a454ee8f1e43..479dd05762a5 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -447,6 +447,15 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
447 | return 0; | 447 | return 0; |
448 | } | 448 | } |
449 | 449 | ||
450 | static char *dvb_nodename(struct device *dev) | ||
451 | { | ||
452 | struct dvb_device *dvbdev = dev_get_drvdata(dev); | ||
453 | |||
454 | return kasprintf(GFP_KERNEL, "dvb/adapter%d/%s%d", | ||
455 | dvbdev->adapter->num, dnames[dvbdev->type], dvbdev->id); | ||
456 | } | ||
457 | |||
458 | |||
450 | static int __init init_dvbdev(void) | 459 | static int __init init_dvbdev(void) |
451 | { | 460 | { |
452 | int retval; | 461 | int retval; |
@@ -469,6 +478,7 @@ static int __init init_dvbdev(void) | |||
469 | goto error; | 478 | goto error; |
470 | } | 479 | } |
471 | dvb_class->dev_uevent = dvb_uevent; | 480 | dvb_class->dev_uevent = dvb_uevent; |
481 | dvb_class->nodename = dvb_nodename; | ||
472 | return 0; | 482 | return 0; |
473 | 483 | ||
474 | error: | 484 | error: |