diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-24 12:46:11 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-24 12:46:11 -0300 |
commit | 9ac332abfea493cd10a9c804cebb81f324071b82 (patch) | |
tree | ae62ebe2957322ccdd08fd09f15ecf8707a3269c /linux/drivers/media/dvb | |
parent | df4770792c09b6afe8b9f6ab4a052329f6150b49 (diff) | |
download | mediapointer-dvb-s2-9ac332abfea493cd10a9c804cebb81f324071b82.tar.gz mediapointer-dvb-s2-9ac332abfea493cd10a9c804cebb81f324071b82.tar.bz2 |
backport commit e282959ef3ebae0d72ac0b24242c376fa34da585
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Author: Greg Kroah-Hartman <gregkh@suse.de>
Date: Wed May 21 12:52:33 2008 -0700
device create: dvb: convert device_create to device_create_drvdata
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.
kernel-sync:
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index e6d20310a..0820da504 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -242,9 +242,15 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, mutex_unlock(&dvbdev_register_lock); +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 26) + clsdev = device_create_drvdata(dvb_class, adap->device, + MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), + NULL, "dvb%d.%s%d", adap->num, dnames[type], id); +#else clsdev = device_create(dvb_class, adap->device, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), "dvb%d.%s%d", adap->num, dnames[type], id); +#endif if (IS_ERR(clsdev)) { printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n", __func__, adap->num, dnames[type], id, PTR_ERR(clsdev)); |