summaryrefslogtreecommitdiff
path: root/drivers/dahdi/voicebus/voicebus.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-02-24 19:19:07 +0000
committerShaun Ruffell <sruffell@digium.com>2010-02-24 19:19:07 +0000
commit139e84c0e994542300f7634715c63b5b0f09a8f3 (patch)
treee59059bfe07162d082c14a139476297040a13428 /drivers/dahdi/voicebus/voicebus.c
parent90200463bfcb7a8199a337116d8fd92bac4cff59 (diff)
Merged revisions 8080 via svnmerge from
https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r8080 | sruffell | 2010-02-24 13:13:05 -0600 (Wed, 24 Feb 2010) | 4 lines wctdm24xxp, wcte12xp: Abort attach if interface fails to come out of reset. If the reset bit never clears, then just assume we cannot talk to the board and error on the attach. DAHDI-515. ........ git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.2@8086 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/voicebus/voicebus.c')
-rw-r--r--drivers/dahdi/voicebus/voicebus.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c
index b77ccdb..dfe59be 100644
--- a/drivers/dahdi/voicebus/voicebus.c
+++ b/drivers/dahdi/voicebus/voicebus.c
@@ -738,8 +738,8 @@ vb_reset_interface(struct voicebus *vb)
} while ((reg & 0x00000001) && time_before(jiffies, timeout));
if (reg & 0x00000001) {
- dev_warn(&vb->pdev->dev, "Hardware did not come out of reset "
- "within 100ms!");
+ dev_warn(&vb->pdev->dev, "Did not come out of reset "
+ "within 100ms\n");
return -EIO;
}
@@ -1801,14 +1801,6 @@ voicebus_init(struct pci_dev *pdev, u32 framesize, const char *board_name,
vb->idle_vbb = dma_alloc_coherent(&vb->pdev->dev, vb->framesize,
&vb->idle_vbb_dma_addr, GFP_KERNEL);
- retval = vb_initialize_tx_descriptors(vb);
- if (retval)
- goto cleanup;
-
- retval = vb_initialize_rx_descriptors(vb);
- if (retval)
- goto cleanup;
-
/* ----------------------------------------------------------------
Configure the hardware interface.
---------------------------------------------------------------- */
@@ -1821,6 +1813,20 @@ voicebus_init(struct pci_dev *pdev, u32 framesize, const char *board_name,
pci_set_master(pdev);
vb_enable_io_access(vb);
+ if (vb_reset_interface(vb)) {
+ retval = -EIO;
+ dev_warn(&vb->pdev->dev, "Failed reset.\n");
+ goto cleanup;
+ }
+
+ retval = vb_initialize_tx_descriptors(vb);
+ if (retval)
+ goto cleanup;
+
+ retval = vb_initialize_rx_descriptors(vb);
+ if (retval)
+ goto cleanup;
+
#if VOICEBUS_DEFERRED != TIMER
retval = request_irq(pdev->irq, vb_isr, DAHDI_IRQ_SHARED,
board_name, vb);
@@ -1865,7 +1871,8 @@ cleanup:
pci_disable_device(vb->pdev);
kfree(vb);
- WARN_ON(0 == retval);
+ if (0 == retval)
+ retval = -EIO;
return retval;
}
EXPORT_SYMBOL(voicebus_init);