[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cdi-devel] [PATCH] Update pcnet to use cdi_wait_irq
Hi,
This patch changes the pcnet driver to use the cdi_wait_irq function instead
of implementing its own solution.
Cheers,
Matt
Signed-off-by: Matthew Iselin <matthew@xxxxxxxxxxxxxx>
---
pcnet/pcnet.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pcnet/pcnet.c b/pcnet/pcnet.c
index 800b795..27d364c 100644
--- a/pcnet/pcnet.c
+++ b/pcnet/pcnet.c
@@ -306,7 +306,9 @@ void pcnet_dev_init(struct pcnet_device *netcard, int promiscuous)
pcnet_write_csr(netcard, CSR_STATUS, STATUS_INIT | STATUS_INTERRUPT_ENABLE);
// Wait until initialization completed, NOTE: see pcnet_handle_interrupt()
- while (netcard->init_wait_for_irq != 0);
+ int irq = cdi_wait_irq(netcard->pci->irq, 1000);
+ if(irq < 0 || netcard->init_wait_for_irq == 1)
+ printf("pcnet: waiting for IRQ failed: %d\n", irq);
// CSR4 Enable transmit auto-padding and receive automatic padding removal
// TODO DMAPLUS?
--
1.6.4.2