/[openvortex]/alsa/alsa-kernel/core/sound.c
ViewVC logotype

Diff of /alsa/alsa-kernel/core/sound.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by vizard, Sat May 31 02:35:09 2003 UTC revision 1.3 by vizard, Sun Jun 15 21:01:30 2003 UTC
# Line 76  static DECLARE_MUTEX(sound_mutex); Line 76  static DECLARE_MUTEX(sound_mutex);
76   */   */
77  void snd_request_card(int card)  void snd_request_card(int card)
78  {  {
         char str[32];  
79          int locked;          int locked;
80    
81          read_lock(&snd_card_rwlock);          read_lock(&snd_card_rwlock);
# Line 86  void snd_request_card(int card) Line 85  void snd_request_card(int card)
85                  return;                  return;
86          if (card < 0 || card >= cards_limit)          if (card < 0 || card >= cards_limit)
87                  return;                  return;
88          sprintf(str, "snd-card-%i", card);          request_module("snd-card-%i", card);
         request_module(str);  
89  }  }
90    
91  static void snd_request_other(int minor)  static void snd_request_other(int minor)
# Line 156  static int snd_open(struct inode *inode, Line 154  static int snd_open(struct inode *inode,
154    
155  struct file_operations snd_fops =  struct file_operations snd_fops =
156  {  {
 #ifndef LINUX_2_2  
157          .owner =        THIS_MODULE,          .owner =        THIS_MODULE,
 #endif  
158          .open =         snd_open          .open =         snd_open
159  };  };
160    
# Line 225  int snd_register_device(int type, snd_ca Line 221  int snd_register_device(int type, snd_ca
221          }          }
222          list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]);          list_add_tail(&preg->list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]);
223  #ifdef CONFIG_DEVFS_FS  #ifdef CONFIG_DEVFS_FS
224          if (strncmp(name, "controlC", 8)) {     /* created in sound.c */          if (strncmp(name, "controlC", 8))     /* created in sound.c */
225                  char dname[32];                  devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name);
                 sprintf(dname, "snd/%s", name);  
                 devfs_register(NULL, dname, DEVFS_FL_DEFAULT,  
                                major, minor, device_mode | S_IFCHR,  
                                &snd_fops, NULL);  
         }  
226  #endif  #endif
227          up(&sound_mutex);          up(&sound_mutex);
228          return 0;          return 0;
# Line 332  static int __init alsa_sound_init(void) Line 323  static int __init alsa_sound_init(void)
323  {  {
324  #ifdef CONFIG_DEVFS_FS  #ifdef CONFIG_DEVFS_FS
325          short controlnum;          short controlnum;
         char controlname[24];  
326  #endif  #endif
327  #ifdef CONFIG_SND_OSSEMUL  #ifdef CONFIG_SND_OSSEMUL
328          int err;          int err;
# Line 368  static int __init alsa_sound_init(void) Line 358  static int __init alsa_sound_init(void)
358          snd_info_minor_register();          snd_info_minor_register();
359  #endif  #endif
360  #ifdef CONFIG_DEVFS_FS  #ifdef CONFIG_DEVFS_FS
361          for (controlnum = 0; controlnum < cards_limit; controlnum++) {          for (controlnum = 0; controlnum < cards_limit; controlnum++)
362                  sprintf(controlname, "snd/controlC%d", controlnum);                  devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum);
                 devfs_register(NULL, controlname, DEVFS_FL_DEFAULT,  
                                 major, controlnum<<5, device_mode | S_IFCHR,  
                                 &snd_fops, NULL);  
         }  
363  #endif  #endif
364  #ifndef MODULE  #ifndef MODULE
365          printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");          printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");
366  #endif  #endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)  
         pm_init();  
 #endif  
367          return 0;          return 0;
368  }  }
369    
# Line 395  static void __exit alsa_sound_exit(void) Line 378  static void __exit alsa_sound_exit(void)
378          snd_info_minor_unregister();          snd_info_minor_unregister();
379  #endif  #endif
380          snd_info_done();          snd_info_done();
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)  
         pm_done();  
 #endif  
381  #ifdef CONFIG_SND_DEBUG_MEMORY  #ifdef CONFIG_SND_DEBUG_MEMORY
382          snd_memory_done();          snd_memory_done();
383  #endif  #endif

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26