patch for 1.9.13

Search this archive.

From: d00l001@ex.media.osaka-cu.ac.jp
Date: Thu 04 Apr 2002 - 14:23:26 IDT


    Hello,

    I downloaded svgalib-1.9.13.tar.gz and tried to compile
on my Linux(Kernel 2.2.14) box.  I found some bugs on
kernel/svgalib_helper/main.c then send a patch:
----------------START OF PATCH--------------------
*** main.c	Thu Apr  4 19:50:32 2002
--- main.c.new	Thu Apr  4 20:18:25 2002
***************
*** 1,5 ****
  #include <linux/module.h>
! 
  #include <linux/kernel.h> /* printk() */
  #include <linux/malloc.h> /* kmalloc() */
  #include <linux/fs.h>     /* everything... */
--- 1,5 ----
  #include <linux/module.h>
! #undef CONFIG_DEVFS_FS /* comment out if your system support devfs */
  #include <linux/kernel.h> /* printk() */
  #include <linux/malloc.h> /* kmalloc() */
  #include <linux/fs.h>     /* everything... */
***************
*** 10,17 ****
  #include <linux/fcntl.h>        /* O_ACCMODE */
  #include <linux/ioport.h>
  #include <linux/pci.h>
  #include <linux/devfs_fs_kernel.h>
! 
  #include <asm/uaccess.h>
  #include <asm/system.h>   /* cli(), *_flags */
  #include <asm/segment.h>  /* memcpy and such */
--- 10,18 ----
  #include <linux/fcntl.h>        /* O_ACCMODE */
  #include <linux/ioport.h>
  #include <linux/pci.h>
+ #ifdef CONFIG_DEVFS_FS
  #include <linux/devfs_fs_kernel.h>
! #endif
  #include <asm/uaccess.h>
  #include <asm/system.h>   /* cli(), *_flags */
  #include <asm/segment.h>  /* memcpy and such */
***************
*** 19,25 ****
  #include <asm/pgtable.h>
  
  #include "svgalib_helper.h"
- 
  int num_devices=0;
  
  static struct sh_pci_device 
--- 20,25 ----
***************
*** 178,184 ****
  }   			
  
  
! static int svgalib_helper_open( struct inode *inode, struct file * filp) {
  
     int minor = MINOR(inode->i_rdev);
     
--- 178,184 ----
  }   			
  
  
! static int svgalib_helper_open( struct inode *inode, struct file *filp) {
  
     int minor = MINOR(inode->i_rdev);
     
***************
*** 279,285 ****
       */
       
      printk(KERN_INFO "svgalib_helper: Initializing, version 1.9.13\n");
!     result = devfs_register_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper", &svgalib_helper_fops);
      if (result < 0) {
          printk(KERN_WARNING "svgalib_helper: can't get major %d\n",SVGALIB_HELPER_MAJOR);
          return result;
--- 279,285 ----
       */
       
      printk(KERN_INFO "svgalib_helper: Initializing, version 1.9.13\n");
!     result = register_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper", &svgalib_helper_fops);
      if (result < 0) {
          printk(KERN_WARNING "svgalib_helper: can't get major %d\n",SVGALIB_HELPER_MAJOR);
          return result;
***************
*** 343,349 ****
      nomem_error:
          for(i=0;i<SVGALIB_HELPER_MAX_NR_DEVICES;i++) 
              if(sh_pci_devs[i])kfree(sh_pci_devs[i]);     
!     devfs_unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
      return result;
  }
  
--- 343,349 ----
      nomem_error:
          for(i=0;i<SVGALIB_HELPER_MAX_NR_DEVICES;i++) 
              if(sh_pci_devs[i])kfree(sh_pci_devs[i]);     
!     unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
      return result;
  }
  
***************
*** 358,362 ****
  #ifdef CONFIG_DEVFS_FS
      devfs_unregister(devfs_handle);
  #endif
!     devfs_unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
  }
--- 358,362 ----
  #ifdef CONFIG_DEVFS_FS
      devfs_unregister(devfs_handle);
  #endif
!     unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
  }
------------------END OF PATCH-------------------

    I think that this patch is useful for Linux machines which
does not support 'devfs' system.

                                Sincerely,
                                    Shingo Mochinushi


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST