home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD2.iso / Sound / soundcore-2.2.1.patch1 < prev   
Text File  |  1999-03-15  |  1KB  |  51 lines

  1. --- linux/drivers/sound/sound_core.c.old    Mon Feb  1 14:06:58 1999
  2. +++ linux/drivers/sound/sound_core.c    Wed Feb 17 11:42:00 1999
  3. @@ -63,6 +63,13 @@
  4.      int n=low;
  5.  
  6.      if (index < 0) {    /* first free */
  7. +
  8. +        while (*list && (*list)->unit_minor<n)
  9. +            list=&((*list)->next);
  10. +
  11. +        if (*list && (*list)->unit_minor==n)
  12. +            return -EBUSY;
  13. +
  14.          while(n<top)
  15.          {
  16.              /* Found a hole ? */
  17. @@ -73,7 +80,7 @@
  18.          }
  19.  
  20.          if(n>=top)
  21. -            return -ENOMEM;
  22. +            return -ENOENT;
  23.      } else {
  24.          n = low+(index*16);
  25.          while (*list) {
  26. @@ -141,13 +148,13 @@
  27.      int r;
  28.      struct sound_unit *s=(struct sound_unit *)kmalloc(sizeof(struct sound_unit), GFP_KERNEL);
  29.      if(s==NULL)
  30. -        return -1;
  31. +        return -ENOMEM;
  32.          
  33.      spin_lock(&sound_loader_lock);
  34.      r=__sound_insert_unit(s,list,fops,index,low,top);
  35.      spin_unlock(&sound_loader_lock);
  36.      
  37. -    if(r==-1)
  38. +    if(r<0)
  39.          kfree(s);
  40.      return r;
  41.  }
  42. @@ -368,7 +375,7 @@
  43.  int soundcore_init(void)
  44.  #endif
  45.  {
  46. -    if(register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1)
  47. +    if(register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)<0)
  48.      {
  49.          printk(KERN_ERR "soundcore: sound device already in use.\n");
  50.          return -EBUSY;
  51.