diff options
author | Dave Jones <davej@redhat.com> | 2008-07-15 19:54:52 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 17:59:30 -0400 |
commit | 1a4dc68b31fd04573ab3c554702372941a4fd46f (patch) | |
tree | a6f48a3d180381b07d3a10cf5dd4bb8dd5c9d6ac /drivers/net/8139too.c | |
parent | 152151daece9d5dfd86e652b95846072c0d2b566 (diff) | |
download | linux-1a4dc68b31fd04573ab3c554702372941a4fd46f.tar.gz linux-1a4dc68b31fd04573ab3c554702372941a4fd46f.tar.bz2 linux-1a4dc68b31fd04573ab3c554702372941a4fd46f.zip |
8139too: Fall back to PIO when MMIO fails.
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/8139too.c')
-rw-r--r-- | drivers/net/8139too.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index f62ac64e98fe..8a5b0d293f75 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -788,6 +788,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, DPRINTK("PIO region size == 0x%02X\n", pio_len); DPRINTK("MMIO region size == 0x%02lX\n", mmio_len); +retry: if (use_io) { /* make sure PCI base addr 0 is PIO */ if (!(pio_flags & IORESOURCE_IO)) { @@ -836,9 +837,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, /* ioremap MMIO region */ ioaddr = pci_iomap(pdev, 1, 0); if (ioaddr == NULL) { - dev_err(&pdev->dev, "cannot remap MMIO, aborting\n"); - rc = -EIO; - goto err_out; + dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n"); + pci_release_regions(pdev); + use_io = 1; + goto retry; } dev->base_addr = (long) ioaddr; tp->regs_len = mmio_len; |