diff options
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index e363a3b5054c..c7990c926942 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -252,7 +252,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
252 | 252 | ||
253 | clsdev = device_create(dvb_class, adap->device, | 253 | clsdev = device_create(dvb_class, adap->device, |
254 | MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), | 254 | MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), |
255 | NULL, "dvb%d.%s%d", adap->num, dnames[type], id); | 255 | dvbdev, "dvb%d.%s%d", adap->num, dnames[type], id); |
256 | if (IS_ERR(clsdev)) { | 256 | if (IS_ERR(clsdev)) { |
257 | printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n", | 257 | printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n", |
258 | __func__, adap->num, dnames[type], id, PTR_ERR(clsdev)); | 258 | __func__, adap->num, dnames[type], id, PTR_ERR(clsdev)); |
@@ -432,6 +432,15 @@ out: | |||
432 | return err; | 432 | return err; |
433 | } | 433 | } |
434 | 434 | ||
435 | static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) | ||
436 | { | ||
437 | struct dvb_device *dvbdev = dev_get_drvdata(dev); | ||
438 | |||
439 | add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id); | ||
440 | add_uevent_var(env, "DVB_ADAPTER_NUM=%d", dvbdev->adapter->num); | ||
441 | return 0; | ||
442 | } | ||
443 | |||
435 | static int __init init_dvbdev(void) | 444 | static int __init init_dvbdev(void) |
436 | { | 445 | { |
437 | int retval; | 446 | int retval; |
@@ -453,6 +462,7 @@ static int __init init_dvbdev(void) | |||
453 | retval = PTR_ERR(dvb_class); | 462 | retval = PTR_ERR(dvb_class); |
454 | goto error; | 463 | goto error; |
455 | } | 464 | } |
465 | dvb_class->dev_uevent = dvb_uevent; | ||
456 | return 0; | 466 | return 0; |
457 | 467 | ||
458 | error: | 468 | error: |