diff options
author | eyck <eyck@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-16 20:19:47 +0000 |
---|---|---|
committer | eyck <eyck@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-16 20:19:47 +0000 |
commit | 247550acdbd7f5bad0ffc8319791b99d34f475dc (patch) | |
tree | cf39b0a917e40ab97e9ee9467b9ab8bc5de5dd1e /drivers | |
parent | affc2f5b7faac9c1c12814dc23b2386163b13794 (diff) |
Mark Schreiber sent link to Marcus Sundburg patch to mga_vid, which enables
mga_vid operation with devfs.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5654 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mga_vid.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/mga_vid.c b/drivers/mga_vid.c index f110121daa..e279b2ee1c 100644 --- a/drivers/mga_vid.c +++ b/drivers/mga_vid.c @@ -57,6 +57,10 @@ #include <asm/mtrr.h> #endif +#ifdef CONFIG_DEVFS_FS +#include <linux/devfs_fs_kernel.h> +#endif + #include <asm/uaccess.h> #include <asm/system.h> #include <asm/io.h> @@ -261,6 +265,10 @@ static struct pci_dev *pci_dev; static mga_vid_config_t mga_config; +#ifdef CONFIG_DEVFS_FS +static devfs_handle_t dev_handle = NULL; +#endif + static int colkey_saved=0; static int colkey_on=0; static unsigned char colkey_color[4]; @@ -1555,8 +1563,17 @@ static int mga_vid_initialize(void) return -EINVAL; } } - +#ifdef CONFIG_DEVFS_FS + if ((dev_handle = devfs_register( + NULL, + "mga_vid", 0, DEVFS_FL_NONE, + MGA_VID_MAJOR, 0, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IFCHR, + 0, 0, + &mga_vid_fops, NULL)) == NULL) +#else if(register_chrdev(MGA_VID_MAJOR, "mga_vid", &mga_vid_fops)) +#endif { printk(KERN_ERR "mga_vid: unable to get major: %d\n", MGA_VID_MAJOR); return -EIO; @@ -1565,7 +1582,11 @@ static int mga_vid_initialize(void) if (!mga_vid_find_card()) { printk(KERN_ERR "mga_vid: no supported devices found\n"); +#ifdef CONFIG_DEVFS_FS + devfs_unregister(dev_handle); +#else unregister_chrdev(MGA_VID_MAJOR, "mga_vid"); +#endif return -EINVAL; } mga_param_buff = kmalloc(PARAM_BUFF_SIZE,GFP_KERNEL); @@ -1594,6 +1615,10 @@ void cleanup_module(void) //FIXME turn off BES printk(KERN_INFO "mga_vid: Cleaning up module\n"); +#ifdef CONFIG_DEVFS_FS + devfs_unregister(dev_handle); +#else unregister_chrdev(MGA_VID_MAJOR, "mga_vid"); +#endif } |