diff options
author | Holger Waechtler <devnull@localhost> | 2003-03-21 15:09:54 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2003-03-21 15:09:54 +0000 |
commit | 8c45d92457f59a0fbf9cfdeb5f93c412ad524812 (patch) | |
tree | 78579bdfe1191e09637f39cea1229b3f48a27988 /linux/drivers/media/dvb/dvb-core/dvbdev.c | |
parent | 5673904df7d5dd00df35988fd6fda922b4000398 (diff) | |
download | mediapointer-dvb-s2-8c45d92457f59a0fbf9cfdeb5f93c412ad524812.tar.gz mediapointer-dvb-s2-8c45d92457f59a0fbf9cfdeb5f93c412ad524812.tar.bz2 |
many more portability changes
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index 267bc1fa4..e625b595d 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -21,19 +21,14 @@ * */ -#include <linux/config.h> -#include <linux/version.h> +#include <asm/types.h> +#include <asm/errno.h> +#include <asm/semaphore.h> +#include <linux/string.h> #include <linux/module.h> -#include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> -#include <linux/mm.h> -#include <linux/string.h> -#include <linux/errno.h> #include <linux/init.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/kmod.h> #include <linux/slab.h> #include "dvbdev.h" @@ -58,13 +53,11 @@ static char *dnames[] = { #define DVB_MAX_IDS ~0 #define nums2minor(num,type,id) 0 - #define DVB_DEVFS_FLAGS (DEVFS_FL_DEFAULT|DEVFS_FL_AUTO_DEVNUM) #else #define DVB_MAX_IDS 4 #define nums2minor(num,type,id) ((num << 6) | (id << 4) | type) - #define DVB_DEVFS_FLAGS (DEVFS_FL_DEFAULT) static struct dvb_device* dvbdev_find_device (int minor) @@ -198,9 +191,9 @@ skip: int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type) { - u32 id; - char name [20]; struct dvb_device *dvbdev; + char name [20]; + int id; if (down_interruptible (&dvbdev_register_lock)) return -ERESTARTSYS; @@ -229,9 +222,9 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, list_add_tail (&dvbdev->list_head, &adap->device_list); - sprintf(name, "%s%d", dnames[type], id); + snprintf(name, sizeof(name), "%s%d", dnames[type], id); dvbdev->devfs_handle = devfs_register(adap->devfs_handle, name, - DVB_DEVFS_FLAGS, + DEVFS_FL_DEFAULT, DVB_MAJOR, nums2minor(adap->num, type, id), S_IFCHR | S_IRUSR | S_IWUSR, @@ -305,7 +298,7 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name) printk ("DVB: registering new adapter (%s).\n", name); - sprintf(dirname, "adapter%d", num); + snprintf(dirname, sizeof(dirname), "adapter%d", num); adap->devfs_handle = devfs_mk_dir(dvb_devfs_handle, dirname, NULL); adap->num = num; adap->name = name; |