Commit 4a1821e4 authored by Michael Buesch's avatar Michael Buesch Committed by John W. Linville

[PATCH] bcm43xx: remove check for mmio length, as it differs among platforms. (especially embedded)

Signed-off-by: default avatarMichael Buesch <mbuesch@freenet.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5808bbbd
...@@ -3386,23 +3386,17 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) ...@@ -3386,23 +3386,17 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
struct net_device *net_dev = bcm->net_dev; struct net_device *net_dev = bcm->net_dev;
int err; int err;
int i; int i;
void __iomem *ioaddr; unsigned long mmio_start, mmio_flags, mmio_len;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
u32 coremask; u32 coremask;
err = pci_enable_device(pci_dev); err = pci_enable_device(pci_dev);
if (err) { if (err) {
printk(KERN_ERR PFX "unable to wake up pci device (%i)\n", err); printk(KERN_ERR PFX "unable to wake up pci device (%i)\n", err);
err = -ENODEV;
goto out; goto out;
} }
mmio_start = pci_resource_start(pci_dev, 0); mmio_start = pci_resource_start(pci_dev, 0);
mmio_end = pci_resource_end(pci_dev, 0);
mmio_flags = pci_resource_flags(pci_dev, 0); mmio_flags = pci_resource_flags(pci_dev, 0);
mmio_len = pci_resource_len(pci_dev, 0); mmio_len = pci_resource_len(pci_dev, 0);
/* make sure PCI base addr is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) { if (!(mmio_flags & IORESOURCE_MEM)) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
"%s, region #0 not an MMIO resource, aborting\n", "%s, region #0 not an MMIO resource, aborting\n",
...@@ -3410,39 +3404,23 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) ...@@ -3410,39 +3404,23 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm)
err = -ENODEV; err = -ENODEV;
goto err_pci_disable; goto err_pci_disable;
} }
//FIXME: Why is this check disabled for BCM947XX? What is the IO_SIZE there?
#ifndef CONFIG_BCM947XX
if (mmio_len != BCM43xx_IO_SIZE) {
printk(KERN_ERR PFX
"%s: invalid PCI mem region size(s), aborting\n",
pci_name(pci_dev));
err = -ENODEV;
goto err_pci_disable;
}
#endif
err = pci_request_regions(pci_dev, KBUILD_MODNAME); err = pci_request_regions(pci_dev, KBUILD_MODNAME);
if (err) { if (err) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
"could not access PCI resources (%i)\n", err); "could not access PCI resources (%i)\n", err);
goto err_pci_disable; goto err_pci_disable;
} }
/* enable PCI bus-mastering */ /* enable PCI bus-mastering */
pci_set_master(pci_dev); pci_set_master(pci_dev);
bcm->mmio_addr = ioremap(mmio_start, mmio_len);
/* ioremap MMIO region */ if (!bcm->mmio_addr) {
ioaddr = ioremap(mmio_start, mmio_len);
if (!ioaddr) {
printk(KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", printk(KERN_ERR PFX "%s: cannot remap MMIO, aborting\n",
pci_name(pci_dev)); pci_name(pci_dev));
err = -EIO; err = -EIO;
goto err_pci_release; goto err_pci_release;
} }
net_dev->base_addr = (unsigned long)ioaddr;
bcm->mmio_addr = ioaddr;
bcm->mmio_len = mmio_len; bcm->mmio_len = mmio_len;
net_dev->base_addr = (unsigned long)bcm->mmio_addr;
bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID,
&bcm->board_vendor); &bcm->board_vendor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment