diff options
author | Michael Hunold <devnull@localhost> | 2003-05-28 07:46:27 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2003-05-28 07:46:27 +0000 |
commit | 0df7b4ed2d78a2ba2001aaee8963cc1091b4070b (patch) | |
tree | 6857fa30358730a8c9b0ffdecf961e3e0bce54e6 /linux/drivers/media/dvb/dvb-core/dvbdev.c | |
parent | 2feacfc60c10a49db84307b7e1fb63d19349d484 (diff) | |
download | mediapointer-dvb-s2-0df7b4ed2d78a2ba2001aaee8963cc1091b4070b.tar.gz mediapointer-dvb-s2-0df7b4ed2d78a2ba2001aaee8963cc1091b4070b.tar.bz2 |
Feed 2.5 changes to CVS.
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.c | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index 3848c873f..1963ac731 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -38,9 +38,6 @@ static int dvbdev_debug = 0; #define dprintk if (dvbdev_debug) printk -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -static devfs_handle_t dvb_devfs_handle; -#endif static LIST_HEAD(dvb_adapter_list); static DECLARE_MUTEX(dvbdev_register_lock); @@ -194,7 +191,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type) { struct dvb_device *dvbdev; - char name[64]; int id; if (down_interruptible (&dvbdev_register_lock)) @@ -225,6 +221,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, list_add_tail (&dvbdev->list_head, &adap->device_list); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) + { + char name[64]; snprintf(name, sizeof(name), "%s%d", dnames[type], id); dvbdev->devfs_handle = devfs_register(adap->devfs_handle, name, DEVFS_FL_DEFAULT, @@ -232,18 +230,19 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, nums2minor(adap->num, type, id), S_IFCHR | S_IRUSR | S_IWUSR, dvbdev->fops, dvbdev); -#else - snprintf(name, sizeof(name), "dvb/adapter%d/%s%d", adap->num, dnames[type], id); - dvbdev->devfs_handle = devfs_register(NULL, name, - DEVFS_FL_DEFAULT, - DVB_MAJOR, - nums2minor(adap->num, type, id), - S_IFCHR | S_IRUSR | S_IWUSR, - dvbdev->fops, dvbdev); -#endif dprintk("DVB: register adapter%d/%s @ minor: %i (0x%02x)\n", adap->num, name, nums2minor(adap->num, type, id), nums2minor(adap->num, type, id)); + } +#else + devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), + S_IFCHR | S_IRUSR | S_IWUSR, + "dvb/adapter%d/%s%d", adap->num, dnames[type], id); + + dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", + adap->num, dnames[type], id, nums2minor(adap->num, type, id), + nums2minor(adap->num, type, id)); +#endif return 0; } @@ -251,21 +250,14 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, void dvb_unregister_device(struct dvb_device *dvbdev) { -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) - char name[64]; - struct dvb_adapter *adap = dvbdev->adapter; -#endif - if (!dvbdev) return; #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) devfs_unregister(dvbdev->devfs_handle); #else - snprintf(name, sizeof(name), "dvb/adapter%d/%s%d", adap->num, dnames[dvbdev->type], dvbdev->id); - /* fixme */ - printk("dvb_unregister_device: %s\n",name); - devfs_remove(name); + devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num, + dnames[dvbdev->type], dvbdev->id); #endif list_del (&dvbdev->list_head); kfree (dvbdev); @@ -296,7 +288,6 @@ skip: int dvb_register_adapter(struct dvb_adapter **padap, const char *name) { - char dirname[64]; struct dvb_adapter *adap; int num; @@ -319,11 +310,13 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name) printk ("DVB: registering new adapter (%s).\n", name); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) + { + char dirname[64]; snprintf(dirname, sizeof(dirname), "adapter%d", num); adap->devfs_handle = devfs_mk_dir(dvb_devfs_handle, dirname, NULL); + } #else - snprintf(dirname, sizeof(dirname), "dvb/adapter%d", num); - devfs_mk_dir(dirname); + devfs_mk_dir("dvb/adapter%d", num); #endif adap->num = num; adap->name = name; @@ -341,9 +334,7 @@ int dvb_unregister_adapter(struct dvb_adapter *adap) #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) devfs_unregister(adap->devfs_handle); #else - char dirname[64]; /* fixme */ - snprintf(dirname, sizeof(dirname), "dvb/adapter%d", adap->num); - devfs_remove(dirname); + devfs_remove("dvb/adapter%d", adap->num); #endif if (down_interruptible (&dvbdev_register_lock)) return -ERESTARTSYS; |