[svn-commits] russell: branch russell/sandbox r2982 - /team/russell/sandbox/wctdm.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 30 16:06:45 CDT 2007


Author: russell
Date: Thu Aug 30 16:06:44 2007
New Revision: 2982

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2982
Log:
reduce some nesting

Modified:
    team/russell/sandbox/wctdm.c

Modified: team/russell/sandbox/wctdm.c
URL: http://svn.digium.com/view/zaptel/team/russell/sandbox/wctdm.c?view=diff&rev=2982&r1=2981&r2=2982
==============================================================================
--- team/russell/sandbox/wctdm.c (original)
+++ team/russell/sandbox/wctdm.c Thu Aug 30 16:06:44 2007
@@ -2385,28 +2385,29 @@
 static void __devexit wctdm_remove_one(struct pci_dev *pdev)
 {
 	struct wctdm *wc = pci_get_drvdata(pdev);
-	if (wc) {
-
-		/* Stop any DMA */
-		wctdm_stop_dma(wc);
-		wctdm_reset_tdm(wc);
-
-		/* In case hardware is still there */
-		wctdm_disable_interrupts(wc);
+
+	if (!wc)
+		return;
+
+	/* Stop any DMA */
+	wctdm_stop_dma(wc);
+	wctdm_reset_tdm(wc);
+
+	/* In case hardware is still there */
+	wctdm_disable_interrupts(wc);
 		
-		/* Immediately free resources */
-		pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
-		free_irq(pdev->irq, wc);
-
-		/* Reset PCI chip and registers */
-		outb(0x0e, wc->ioaddr + WC_CNTL);
-
-		/* Release span, possibly delayed */
-		if (!wc->usecount)
-			wctdm_release(wc);
-		else
-			wc->dead = 1;
-	}
+	/* Immediately free resources */
+	pci_free_consistent(pdev, ZT_MAX_CHUNKSIZE * 2 * 2 * 2 * 4, (void *)wc->writechunk, wc->writedma);
+	free_irq(pdev->irq, wc);
+
+	/* Reset PCI chip and registers */
+	outb(0x0e, wc->ioaddr + WC_CNTL);
+
+	/* Release span, possibly delayed */
+	if (!wc->usecount)
+		wctdm_release(wc);
+	else
+		wc->dead = 1;
 }
 
 static struct pci_device_id wctdm_pci_tbl[] = {




More information about the svn-commits mailing list