diff options
author | Michael Buesch <mb@bu3sch.de> | 2006-04-09 20:08:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-04-24 16:15:53 -0400 |
commit | cc9357104b19b2b0377713c33d87d78518912c3d (patch) | |
tree | e53b117c4d01ef0f4d567d6f7e0891f24fc89fb3 /drivers/net/wireless/bcm43xx/bcm43xx_main.c | |
parent | f298a2ec62e51cc81b85a120d8fa5b9f8f5a94b1 (diff) |
[PATCH] bcm43xx: use pci_iomap() for convenience.
This reduces codesize.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_main.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 9a06e61df0a2..198528660721 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -3288,8 +3288,7 @@ static void bcm43xx_detach_board(struct bcm43xx_private *bcm) | |||
3288 | 3288 | ||
3289 | bcm43xx_chipset_detach(bcm); | 3289 | bcm43xx_chipset_detach(bcm); |
3290 | /* Do _not_ access the chip, after it is detached. */ | 3290 | /* Do _not_ access the chip, after it is detached. */ |
3291 | iounmap(bcm->mmio_addr); | 3291 | pci_iounmap(pci_dev, bcm->mmio_addr); |
3292 | |||
3293 | pci_release_regions(pci_dev); | 3292 | pci_release_regions(pci_dev); |
3294 | pci_disable_device(pci_dev); | 3293 | pci_disable_device(pci_dev); |
3295 | 3294 | ||
@@ -3379,40 +3378,26 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) | |||
3379 | struct net_device *net_dev = bcm->net_dev; | 3378 | struct net_device *net_dev = bcm->net_dev; |
3380 | int err; | 3379 | int err; |
3381 | int i; | 3380 | int i; |
3382 | unsigned long mmio_start, mmio_flags, mmio_len; | ||
3383 | u32 coremask; | 3381 | u32 coremask; |
3384 | 3382 | ||
3385 | err = pci_enable_device(pci_dev); | 3383 | err = pci_enable_device(pci_dev); |
3386 | if (err) { | 3384 | if (err) { |
3387 | printk(KERN_ERR PFX "unable to wake up pci device (%i)\n", err); | 3385 | printk(KERN_ERR PFX "pci_enable_device() failed\n"); |
3388 | goto out; | 3386 | goto out; |
3389 | } | 3387 | } |
3390 | mmio_start = pci_resource_start(pci_dev, 0); | ||
3391 | mmio_flags = pci_resource_flags(pci_dev, 0); | ||
3392 | mmio_len = pci_resource_len(pci_dev, 0); | ||
3393 | if (!(mmio_flags & IORESOURCE_MEM)) { | ||
3394 | printk(KERN_ERR PFX | ||
3395 | "%s, region #0 not an MMIO resource, aborting\n", | ||
3396 | pci_name(pci_dev)); | ||
3397 | err = -ENODEV; | ||
3398 | goto err_pci_disable; | ||
3399 | } | ||
3400 | err = pci_request_regions(pci_dev, KBUILD_MODNAME); | 3388 | err = pci_request_regions(pci_dev, KBUILD_MODNAME); |
3401 | if (err) { | 3389 | if (err) { |
3402 | printk(KERN_ERR PFX | 3390 | printk(KERN_ERR PFX "pci_request_regions() failed\n"); |
3403 | "could not access PCI resources (%i)\n", err); | ||
3404 | goto err_pci_disable; | 3391 | goto err_pci_disable; |
3405 | } | 3392 | } |
3406 | /* enable PCI bus-mastering */ | 3393 | /* enable PCI bus-mastering */ |
3407 | pci_set_master(pci_dev); | 3394 | pci_set_master(pci_dev); |
3408 | bcm->mmio_addr = ioremap(mmio_start, mmio_len); | 3395 | bcm->mmio_addr = pci_iomap(pci_dev, 0, ~0UL); |
3409 | if (!bcm->mmio_addr) { | 3396 | if (!bcm->mmio_addr) { |
3410 | printk(KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", | 3397 | printk(KERN_ERR PFX "pci_iomap() failed\n"); |
3411 | pci_name(pci_dev)); | ||
3412 | err = -EIO; | 3398 | err = -EIO; |
3413 | goto err_pci_release; | 3399 | goto err_pci_release; |
3414 | } | 3400 | } |
3415 | bcm->mmio_len = mmio_len; | ||
3416 | net_dev->base_addr = (unsigned long)bcm->mmio_addr; | 3401 | net_dev->base_addr = (unsigned long)bcm->mmio_addr; |
3417 | 3402 | ||
3418 | bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, | 3403 | bcm43xx_pci_read_config16(bcm, PCI_SUBSYSTEM_VENDOR_ID, |
@@ -3505,7 +3490,7 @@ err_80211_unwind: | |||
3505 | err_chipset_detach: | 3490 | err_chipset_detach: |
3506 | bcm43xx_chipset_detach(bcm); | 3491 | bcm43xx_chipset_detach(bcm); |
3507 | err_iounmap: | 3492 | err_iounmap: |
3508 | iounmap(bcm->mmio_addr); | 3493 | pci_iounmap(pci_dev, bcm->mmio_addr); |
3509 | err_pci_release: | 3494 | err_pci_release: |
3510 | pci_release_regions(pci_dev); | 3495 | pci_release_regions(pci_dev); |
3511 | err_pci_disable: | 3496 | err_pci_disable: |