# HG changeset patch # User arpi # Date 1019401664 0 # Node ID 1e07af707b15db11587a284bc39e5a60a6cd2b95 # Parent e9fb293c53d2cb32659df519fc7a3898a9c3a763 devfs fix? diff -r e9fb293c53d2 -r 1e07af707b15 drivers/mga_vid.c --- a/drivers/mga_vid.c Sun Apr 21 14:36:36 2002 +0000 +++ b/drivers/mga_vid.c Sun Apr 21 15:07:44 2002 +0000 @@ -102,7 +102,9 @@ static uint32_t mga_param_buff_size=0; static uint32_t mga_param_buff_len=0; +#ifndef min #define min(x,y) (((x)<(y))?(x):(y)) +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) #include @@ -1577,9 +1579,12 @@ MGA_VID_MAJOR, 0, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IFCHR, &mga_vid_fops, NULL)) == NULL) -#else + { + printk(KERN_ERR "mga_vid: unable to get major: %d (devfs)\n", MGA_VID_MAJOR); + return -EIO; + } +#endif 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; @@ -1590,9 +1595,8 @@ printk(KERN_ERR "mga_vid: no supported devices found\n"); #ifdef CONFIG_DEVFS_FS devfs_unregister(dev_handle); -#else +#endif unregister_chrdev(MGA_VID_MAJOR, "mga_vid"); -#endif return -EINVAL; } mga_param_buff = kmalloc(PARAM_BUFF_SIZE,GFP_KERNEL); @@ -1623,8 +1627,7 @@ printk(KERN_INFO "mga_vid: Cleaning up module\n"); #ifdef CONFIG_DEVFS_FS devfs_unregister(dev_handle); -#else +#endif unregister_chrdev(MGA_VID_MAJOR, "mga_vid"); -#endif }