[dahdi-commits] sruffell: branch linux/sruffell/dahdi-linux-chainedvb r7325 - /linux/team/sru...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Oct 2 16:42:39 CDT 2009


Author: sruffell
Date: Fri Oct  2 16:42:26 2009
New Revision: 7325

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7325
Log:
voicebus: Remove the VB_PRINTK macro.

Unnecessarily duplicates the dev_xxx macros.  Also removes the need for the
board_name member from struct voicebus.

Modified:
    linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c

Modified: linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=7325&r1=7324&r2=7325
==============================================================================
--- linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/team/sruffell/dahdi-linux-chainedvb/drivers/dahdi/voicebus/voicebus.c Fri Oct  2 16:42:26 2009
@@ -169,8 +169,6 @@
  *
  */
 struct voicebus {
-	/*! Name of this card. */
-	const char *board_name;
 	/*! The system pci device for this VoiceBus interface. */
 	struct pci_dev *pdev;
 	/*! Protects access to card registers and this structure. You should
@@ -257,10 +255,6 @@
 #define VBUNLOCK_FROM_DEFERRED(_vb_)	spin_lock(&((_vb_)->lock))
 #endif
 
-#define VB_PRINTK(_vb, _lvl, _fmt, _args...) \
-	printk(KERN_##_lvl "%s: " _fmt, (_vb)->board_name, ## _args)
-
-
 #if VOICEBUS_DEFERRED == WORKQUEUE
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
@@ -504,10 +498,10 @@
 	 */
 #define MESSAGE "%d ms is an invalid value for minumum latency.  Setting to %d ms.\n"
 	if (MAX_LATENCY < ms) {
-		VB_PRINTK(vb, WARNING, MESSAGE, ms, MAX_LATENCY);
+		dev_warn(&vb->pdev->dev, MESSAGE, ms, MAX_LATENCY);
 		return -EINVAL;
 	} else if (VOICEBUS_DEFAULT_LATENCY > ms) {
-		VB_PRINTK(vb, WARNING, MESSAGE, ms, VOICEBUS_DEFAULT_LATENCY);
+		dev_warn(&vb->pdev->dev, MESSAGE, ms, VOICEBUS_DEFAULT_LATENCY);
 		return -EINVAL;
 	}
 	VBLOCK(vb);
@@ -729,11 +723,12 @@
 		pci_access = DEFAULT_PCI_ACCESS | (0x3 << 14);
 		break;
 	default:
-		if (atomic_read(&vb->debuglevel))
-			VB_PRINTK(vb, WARNING, "Host system set a cache size "\
-			 "of %d which is not supported. " \
-			 "Disabling memory write line and memory read line.\n",
-			 vb->cache_line_size);
+		if (atomic_read(&vb->debuglevel)) {
+			dev_warn(&vb->pdev->dev, "Host system set a cache "
+				 "size of %d which is not supported. "
+				 "Disabling memory write line and memory "
+				 "read line.\n", vb->cache_line_size);
+		}
 		pci_access = 0xfe584202;
 		break;
 	}
@@ -749,7 +744,7 @@
 	} while ((reg & 0x00000001) && time_before(jiffies, timeout));
 
 	if (reg & 0x00000001) {
-		VB_PRINTK(vb, ERR, "Hardware did not come out of reset "\
+		dev_warn(&vb->pdev->dev, "Hardware did not come out of reset "\
 		 "within 100ms!");
 		return -EIO;
 	}
@@ -1219,9 +1214,8 @@
 	if (vb_wait_for_completion_timeout(&vb->stopped_completion, HZ)) {
 		assert(vb_is_stopped(vb));
 	} else {
-		VB_PRINTK(vb, WARNING, "Timeout while waiting for board to "\
+		dev_warn(&vb->pdev->dev, "Timeout while waiting for board to "\
 			"stop.\n");
-
 
 		vb_clear_start_transmit_bit(vb);
 		vb_clear_start_receive_bit(vb);
@@ -1290,7 +1284,7 @@
 			/* We must subtract two from this number since there
 			 * are always two buffers in the TX FIFO.
 			 */
-			VB_PRINTK(vb, ERR,
+			dev_err(&vb->pdev->dev,
 				"ERROR: Unable to service card within %d ms "\
 				"and unable to further increase latency.\n",
 				MAX_LATENCY-2);
@@ -1305,7 +1299,7 @@
 		 * set, then the hardware will set the TX descriptor not
 		 * available interrupt.
 		 */
-		VB_PRINTK(vb, INFO, "Missed interrupt. " \
+		dev_info(&vb->pdev->dev, "Missed interrupt. " \
 			"Increasing latency to %d ms in order to compensate.\n",
 			latency + increase);
 		/* Set the minimum latency in case we're restarted...we don't
@@ -1439,7 +1433,7 @@
 		}
 
 		if (int_status & FATAL_BUS_ERROR_INTERRUPT)
-			VB_PRINTK(vb, ERR, "Fatal Bus Error detected!\n");
+			dev_err(&vb->pdev->dev, "Fatal Bus Error detected!\n");
 
 		if (int_status & TX_STOPPED_INTERRUPT) {
 			assert(test_bit(STOP, &vb->flags));
@@ -1535,17 +1529,14 @@
 	*vbp = NULL;
 	vb = kmalloc(sizeof(*vb), GFP_KERNEL);
 	if (NULL == vb) {
-		VB_PRINTK(vb, DEBUG, "Failed to allocate memory for voicebus "\
-			"interface.\n");
+		dev_dbg(&vb->pdev->dev, "Failed to allocate memory for " \
+			"voicebus interface.\n");
 		retval = -ENOMEM;
 		goto cleanup;
 	}
 	memset(vb, 0, sizeof(*vb));
 	voicebus_setdebuglevel(vb, debuglevel);
-	/* \todo make sure there is a note that the caller needs to make sure
-	 * board_name stays in memory until voicebus_release is called.
-	 */
-	vb->board_name = board_name;
+
 	spin_lock_init(&vb->lock);
 	init_completion(&vb->stopped_completion);
 	vb->pdev = pdev;
@@ -1594,7 +1585,7 @@
 				SLAB_HWCACHE_ALIGN, NULL);
 #endif
 	if (NULL == vb->buffer_cache) {
-		VB_PRINTK(vb, ERR, "Failed to allocate buffer cache.\n");
+		dev_err(&vb->pdev->dev, "Failed to allocate buffer cache.\n");
 		goto cleanup;
 	}
 
@@ -1603,13 +1594,13 @@
 	   Configure the hardware / kernel module interfaces.
 	   ---------------------------------------------------------------- */
 	if (pci_read_config_byte(vb->pdev, 0x0c, &vb->cache_line_size)) {
-		VB_PRINTK(vb, ERR, "Failed read of cache line " \
+		dev_err(&vb->pdev->dev, "Failed read of cache line " \
 		 "size from PCI configuration space.\n");
 		goto cleanup;
 	}
 
 	if (pci_enable_device(pdev)) {
-		VB_PRINTK(vb, ERR, "Failed call to pci_enable_device.\n");
+		dev_err(&vb->pdev->dev, "Failed call to pci_enable_device.\n");
 		retval = -EIO;
 		goto cleanup;
 	}
@@ -1617,13 +1608,13 @@
 	/* \todo This driver should be modified to use the memory mapped I/O
 	   as opposed to IO space for portability and performance. */
 	if (0 == (pci_resource_flags(pdev, 0)&IORESOURCE_IO)) {
-		VB_PRINTK(vb, ERR, "BAR0 is not IO Memory.\n");
+		dev_err(&vb->pdev->dev, "BAR0 is not IO Memory.\n");
 		retval = -EIO;
 		goto cleanup;
 	}
 	vb->iobase = pci_resource_start(pdev, 0);
 	if (NULL == request_region(vb->iobase, 0xff, board_name)) {
-		VB_PRINTK(vb, ERR, "IO Registers are in use by another " \
+		dev_err(&vb->pdev->dev, "IO Registers are in use by another " \
 			"module.\n");
 		retval = -EIO;
 		goto cleanup;
@@ -1663,7 +1654,7 @@
 #else
 #	define VB_IRQ_SHARED	IRQF_SHARED
 #endif
-	if (request_irq(pdev->irq, vb_isr, VB_IRQ_SHARED, vb->board_name,
+	if (request_irq(pdev->irq, vb_isr, VB_IRQ_SHARED, board_name,
 		vb)) {
 		assert(0);
 		goto cleanup;




More information about the dahdi-commits mailing list