patch-1.3.9 linux/drivers/sound/dev_table.c

Next file: linux/drivers/sound/dev_table.h
Previous file: linux/drivers/sound/coproc.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.8/linux/drivers/sound/dev_table.c linux/drivers/sound/dev_table.c
@@ -52,6 +52,8 @@
   int             i, n = sizeof (snd_installed_cards) / sizeof (struct card_info);
   int             drv;
 
+  printk ("Sound initialization started\n");
+
   for (i = 0; i < (n - 1); i++)
     if (snd_installed_cards[i].enabled)
       if ((drv = snd_find_driver (snd_installed_cards[i].card_type)) == -1)
@@ -77,74 +79,75 @@
 	snd_installed_cards[i].enabled = 0;	/*
 						 * Mark as not detected
 						 */
+  printk ("Sound initialization complete\n");
   return mem_start;
 }
 
 int
 sndtable_probe (int unit, struct address_info *hw_config)
-  {
-    int             i, n = sizeof (snd_installed_cards) / sizeof (struct card_info);
+{
+  int             i, n = sizeof (snd_installed_cards) / sizeof (struct card_info);
 
-    if (!unit)
-      return TRUE;
+  if (!unit)
+    return TRUE;
+
+  for (i = 0; i < (n - 1); i++)
+    if (snd_installed_cards[i].enabled)
+      if (snd_installed_cards[i].card_type == unit)
+	{
+	  int             drv;
 
-    for (i = 0; i < (n - 1); i++)
-      if (snd_installed_cards[i].enabled)
-	if (snd_installed_cards[i].card_type == unit)
-	  {
-	    int             drv;
-
-	    snd_installed_cards[i].config.io_base = hw_config->io_base;
-	    snd_installed_cards[i].config.irq = hw_config->irq;
-	    snd_installed_cards[i].config.dma = hw_config->dma;
-	    if ((drv = snd_find_driver (snd_installed_cards[i].card_type)) == -1)
-	      snd_installed_cards[i].enabled = 0;	/*
+	  snd_installed_cards[i].config.io_base = hw_config->io_base;
+	  snd_installed_cards[i].config.irq = hw_config->irq;
+	  snd_installed_cards[i].config.dma = hw_config->dma;
+	  if ((drv = snd_find_driver (snd_installed_cards[i].card_type)) == -1)
+	    snd_installed_cards[i].enabled = 0;		/*
 							 * Mark as not
 							 * detected
 							 */
-	    else if (sound_drivers[drv].probe (hw_config))
-	      return 1;
-	    snd_installed_cards[i].enabled = 0;	/*
+	  else if (sound_drivers[drv].probe (hw_config))
+	    return 1;
+	  snd_installed_cards[i].enabled = 0;	/*
 						 * Mark as not detected
 						 */
-	    return 0;
-	  }
+	  return 0;
+	}
 
-    return FALSE;
-  }
+  return FALSE;
+}
 
 int
 sndtable_init_card (int unit, struct address_info *hw_config)
-  {
-    int             i, n = sizeof (snd_installed_cards) / sizeof (struct card_info);
+{
+  int             i, n = sizeof (snd_installed_cards) / sizeof (struct card_info);
 
-    if (!unit)
+  if (!unit)
+    {
+      if (sndtable_init (0) != 0)
+	panic ("snd: Invalid memory allocation\n");
+      return TRUE;
+    }
+
+  for (i = 0; i < (n - 1); i++)
+    if (snd_installed_cards[i].card_type == unit)
       {
-	if (sndtable_init (0) != 0)
-	  panic ("snd: Invalid memory allocation\n");
-	return TRUE;
-      }
+	int             drv;
 
-    for (i = 0; i < (n - 1); i++)
-      if (snd_installed_cards[i].card_type == unit)
-	{
-	  int             drv;
+	snd_installed_cards[i].config.io_base = hw_config->io_base;
+	snd_installed_cards[i].config.irq = hw_config->irq;
+	snd_installed_cards[i].config.dma = hw_config->dma;
 
-	  snd_installed_cards[i].config.io_base = hw_config->io_base;
-	  snd_installed_cards[i].config.irq = hw_config->irq;
-	  snd_installed_cards[i].config.dma = hw_config->dma;
-
-	  if ((drv = snd_find_driver (snd_installed_cards[i].card_type)) == -1)
-	    snd_installed_cards[i].enabled = 0;	/*
+	if ((drv = snd_find_driver (snd_installed_cards[i].card_type)) == -1)
+	  snd_installed_cards[i].enabled = 0;	/*
 						 * Mark as not detected
 						 */
-	  else if (sound_drivers[drv].attach (0, hw_config) != 0)
-	    panic ("snd#: Invalid memory allocation\n");
-	  return TRUE;
-	}
+	else if (sound_drivers[drv].attach (0, hw_config) != 0)
+	  panic ("snd#: Invalid memory allocation\n");
+	return TRUE;
+      }
 
-    return FALSE;
-  }
+  return FALSE;
+}
 
 int
 sndtable_get_cardcount (void)
@@ -159,8 +162,8 @@
   int             i, n = sizeof (snd_installed_cards) / sizeof (struct card_info);
 
   /*
- * First disable all drivers
- */
+     * First disable all drivers
+   */
 
   for (i = 0; i < n; i++)
     snd_installed_cards[i].enabled = 0;
@@ -168,8 +171,8 @@
   if (ints[0] == 0 || ints[1] == 0)
     return;
   /*
- * Then enable them one by time
- */
+     * Then enable them one by time
+   */
 
   for (i = 1; i <= ints[0]; i++)
     {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this