diff options
Diffstat (limited to 'drivers/staging/media/zoran/videocodec.c')
-rw-r--r-- | drivers/staging/media/zoran/videocodec.c | 68 |
1 files changed, 6 insertions, 62 deletions
diff --git a/drivers/staging/media/zoran/videocodec.c b/drivers/staging/media/zoran/videocodec.c index 28031d3fd757..3af7d02bd910 100644 --- a/drivers/staging/media/zoran/videocodec.c +++ b/drivers/staging/media/zoran/videocodec.c @@ -8,31 +8,21 @@ * (c) 2002 Wolfgang Scherr <scherr@net4you.at> */ -#define VIDEOCODEC_VERSION "v0.2" - #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/slab.h> -// kernel config is here (procfs flag) - -#ifdef CONFIG_PROC_FS -#include <linux/proc_fs.h> -#include <linux/seq_file.h> -#include <linux/uaccess.h> -#endif - #include "videocodec.h" -static int debug; -module_param(debug, int, 0); -MODULE_PARM_DESC(debug, "Debug level (0-4)"); +static int videocodec_debug; +module_param(videocodec_debug, int, 0); +MODULE_PARM_DESC(videocodec_debug, "Debug level (0-4)"); #define dprintk(num, format, args...) \ do { \ - if (debug >= num) \ + if (videocodec_debug >= num) \ printk(format, ##args); \ } while (0) @@ -80,12 +70,9 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) if ((master->flags & h->codec->flags) == master->flags) { dprintk(4, "%s: try '%s'\n", __func__, h->codec->name); - if (!try_module_get(h->codec->owner)) - return NULL; - codec = kmemdup(h->codec, sizeof(struct videocodec), GFP_KERNEL); if (!codec) - goto out_module_put; + goto out_kfree; res = strlen(codec->name); snprintf(codec->name + res, sizeof(codec->name) - res, "[%d]", h->attached); @@ -121,13 +108,10 @@ struct videocodec *videocodec_attach(struct videocodec_master *master) pr_err("%s: no codec found!\n", __func__); return NULL; - out_module_put: - module_put(h->codec->owner); out_kfree: kfree(codec); return NULL; } -EXPORT_SYMBOL(videocodec_attach); int videocodec_detach(struct videocodec *codec) { @@ -168,7 +152,6 @@ int videocodec_detach(struct videocodec *codec) prev->next = a->next; dprintk(4, "videocodec: delete middle\n"); } - module_put(a->codec->owner); kfree(a->codec); kfree(a); h->attached -= 1; @@ -183,7 +166,6 @@ int videocodec_detach(struct videocodec *codec) pr_err("%s: given codec not found!\n", __func__); return -EINVAL; } -EXPORT_SYMBOL(videocodec_detach); int videocodec_register(const struct videocodec *codec) { @@ -216,7 +198,6 @@ int videocodec_register(const struct videocodec *codec) return 0; } -EXPORT_SYMBOL(videocodec_register); int videocodec_unregister(const struct videocodec *codec) { @@ -263,10 +244,8 @@ int videocodec_unregister(const struct videocodec *codec) pr_err("%s: given codec not found!\n", __func__); return -EINVAL; } -EXPORT_SYMBOL(videocodec_unregister); -#ifdef CONFIG_PROC_FS -static int proc_videocodecs_show(struct seq_file *m, void *v) +int videocodec_debugfs_show(struct seq_file *m) { struct codec_list *h = codeclist_top; struct attached_list *a; @@ -293,38 +272,3 @@ static int proc_videocodecs_show(struct seq_file *m, void *v) return 0; } -#endif - -/* ===================== */ -/* hook in driver module */ -/* ===================== */ -static int __init videocodec_init(void) -{ -#ifdef CONFIG_PROC_FS - static struct proc_dir_entry *videocodec_proc_entry; -#endif - - pr_info("Linux video codec intermediate layer: %s\n", VIDEOCODEC_VERSION); - -#ifdef CONFIG_PROC_FS - videocodec_proc_entry = proc_create_single("videocodecs", 0, NULL, proc_videocodecs_show); - if (!videocodec_proc_entry) - pr_err("videocodec: can't init procfs.\n"); -#endif - return 0; -} - -static void __exit videocodec_exit(void) -{ -#ifdef CONFIG_PROC_FS - remove_proc_entry("videocodecs", NULL); -#endif -} - -module_init(videocodec_init); -module_exit(videocodec_exit); - -MODULE_AUTHOR("Wolfgang Scherr <scherr@net4you.at>"); -MODULE_DESCRIPTION("Intermediate API module for video codecs " - VIDEOCODEC_VERSION); -MODULE_LICENSE("GPL"); |