Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32079
b: refs/heads/master
c: 9b91cf9
h: refs/heads/master
i:
  32077: 53b479d
  32075: 8a267ed
  32071: 142f72a
  32063: 88bc901
v: v3
  • Loading branch information
Jeff Garzik committed Jul 5, 2006
1 parent 53e25a5 commit a56cdb5
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 135 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e8a538d865de0eb9813c8a0f2284e920299c0cc
refs/heads/master: 9b91cf9daac41eeaaea57ecfe68dc13bb0305fa9
17 changes: 7 additions & 10 deletions trunk/drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1836,11 +1836,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)

if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
pdev->vendor, pdev->device, pci_rev);
dev_printk(KERN_ERR, &pdev->dev,
"Try the \"8139too\" driver instead.\n");
dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n");
return -ENODEV;
}

Expand Down Expand Up @@ -1878,13 +1877,12 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
pciaddr = pci_resource_start(pdev, 1);
if (!pciaddr) {
rc = -EIO;
dev_printk(KERN_ERR, &pdev->dev, "no MMIO resource\n");
dev_err(&pdev->dev, "no MMIO resource\n");
goto err_out_res;
}
if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
rc = -EIO;
dev_printk(KERN_ERR, &pdev->dev,
"MMIO resource (%llx) too small\n",
dev_err(&pdev->dev, "MMIO resource (%llx) too small\n",
(unsigned long long)pci_resource_len(pdev, 1));
goto err_out_res;
}
Expand All @@ -1899,13 +1897,13 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)

rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"No usable DMA configuration, aborting.\n");
goto err_out_res;
}
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"No usable consistent DMA configuration, "
"aborting.\n");
goto err_out_res;
Expand All @@ -1918,8 +1916,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
regs = ioremap(pciaddr, CP_REGS_SIZE);
if (!regs) {
rc = -EIO;
dev_printk(KERN_ERR, &pdev->dev,
"Cannot map PCI MMIO (%llx@%llx)\n",
dev_err(&pdev->dev, "Cannot map PCI MMIO (%lx@%lx)\n",
(unsigned long long)pci_resource_len(pdev, 1),
(unsigned long long)pciaddr);
goto err_out_res;
Expand Down
27 changes: 10 additions & 17 deletions trunk/drivers/net/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
/* dev and priv zeroed in alloc_etherdev */
dev = alloc_etherdev (sizeof (*tp));
if (dev == NULL) {
dev_printk (KERN_ERR, &pdev->dev,
"Unable to alloc new net device\n");
dev_err(&pdev->dev, "Unable to alloc new net device\n");
return -ENOMEM;
}
SET_MODULE_OWNER(dev);
Expand Down Expand Up @@ -801,29 +800,25 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
#ifdef USE_IO_OPS
/* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) {
dev_printk (KERN_ERR, &pdev->dev,
"region #0 not a PIO resource, aborting\n");
dev_err(&pdev->dev, "region #0 not a PIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
/* check for weird/broken PCI region reporting */
if (pio_len < RTL_MIN_IO_SIZE) {
dev_printk (KERN_ERR, &pdev->dev,
"Invalid PCI I/O region size(s), aborting\n");
dev_err(&pdev->dev, "Invalid PCI I/O region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
#else
/* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags & IORESOURCE_MEM)) {
dev_printk (KERN_ERR, &pdev->dev,
"region #1 not an MMIO resource, aborting\n");
dev_err(&pdev->dev, "region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out;
}
if (mmio_len < RTL_MIN_IO_SIZE) {
dev_printk (KERN_ERR, &pdev->dev,
"Invalid PCI mem region size(s), aborting\n");
dev_err(&pdev->dev, "Invalid PCI mem region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
Expand All @@ -840,7 +835,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
#ifdef USE_IO_OPS
ioaddr = ioport_map(pio_start, pio_len);
if (!ioaddr) {
dev_printk (KERN_ERR, &pdev->dev, "cannot map PIO, aborting\n");
dev_err(&pdev->dev, "cannot map PIO, aborting\n");
rc = -EIO;
goto err_out;
}
Expand All @@ -851,8 +846,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
/* ioremap MMIO region */
ioaddr = pci_iomap(pdev, 1, 0);
if (ioaddr == NULL) {
dev_printk (KERN_ERR, &pdev->dev,
"cannot remap MMIO, aborting\n");
dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out;
}
Expand All @@ -866,8 +860,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,

/* check for missing/broken hardware */
if (RTL_R32 (TxConfig) == 0xFFFFFFFF) {
dev_printk (KERN_ERR, &pdev->dev,
"Chip not responding, ignoring board\n");
dev_err(&pdev->dev, "Chip not responding, ignoring board\n");
rc = -EIO;
goto err_out;
}
Expand Down Expand Up @@ -961,10 +954,10 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,

if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) {
dev_printk(KERN_INFO, &pdev->dev,
dev_info(&pdev->dev,
"This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
pdev->vendor, pdev->device, pci_rev);
dev_printk(KERN_INFO, &pdev->dev,
dev_info(&pdev->dev,
"Use the \"8139cp\" driver for improved performance and stability.\n");
}

Expand Down
23 changes: 9 additions & 14 deletions trunk/drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -2120,13 +2120,13 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

err = pci_enable_device(pdev);
if (err) {
dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
dev_err(&pdev->dev, "Cannot enable PCI device, "
"aborting.\n");
return err;
}

if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"Cannot find proper PCI device "
"base address, aborting.\n");
err = -ENODEV;
Expand All @@ -2135,7 +2135,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

err = pci_request_regions(pdev, DRV_MODULE_NAME);
if (err) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"Cannot obtain PCI resources, aborting.\n");
goto err_out_disable_pdev;
}
Expand All @@ -2144,15 +2144,13 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
dev_printk(KERN_ERR, &pdev->dev,
"No usable DMA configuration, aborting.\n");
dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
}

err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
dev_printk(KERN_ERR, &pdev->dev,
"No usable DMA configuration, aborting.\n");
dev_err(&pdev->dev, "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
}

Expand All @@ -2161,8 +2159,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

dev = alloc_etherdev(sizeof(*bp));
if (!dev) {
dev_printk(KERN_ERR, &pdev->dev,
"Etherdev alloc failed, aborting.\n");
dev_err(&pdev->dev, "Etherdev alloc failed, aborting.\n");
err = -ENOMEM;
goto err_out_free_res;
}
Expand All @@ -2183,8 +2180,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

bp->regs = ioremap(b44reg_base, b44reg_len);
if (bp->regs == 0UL) {
dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
"aborting.\n");
dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
err = -ENOMEM;
goto err_out_free_dev;
}
Expand Down Expand Up @@ -2214,7 +2210,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

err = b44_get_invariants(bp);
if (err) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"Problem fetching invariants of chip, aborting.\n");
goto err_out_iounmap;
}
Expand All @@ -2235,8 +2231,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,

err = register_netdev(dev);
if (err) {
dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
"aborting.\n");
dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
goto err_out_iounmap;
}

Expand Down
29 changes: 11 additions & 18 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5575,55 +5575,51 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
/* enable device (incl. PCI PM wakeup), and bus-mastering */
rc = pci_enable_device(pdev);
if (rc) {
dev_printk(KERN_ERR, &pdev->dev,
"Cannot enable PCI device, aborting.");
dev_err(&pdev->dev, "Cannot enable PCI device, aborting.");
goto err_out;
}

if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"Cannot find PCI device base address, aborting.\n");
rc = -ENODEV;
goto err_out_disable;
}

rc = pci_request_regions(pdev, DRV_MODULE_NAME);
if (rc) {
dev_printk(KERN_ERR, &pdev->dev,
"Cannot obtain PCI resources, aborting.\n");
dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
goto err_out_disable;
}

pci_set_master(pdev);

bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
if (bp->pm_cap == 0) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"Cannot find power management capability, aborting.\n");
rc = -EIO;
goto err_out_release;
}

bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
if (bp->pcix_cap == 0) {
dev_printk(KERN_ERR, &pdev->dev,
"Cannot find PCIX capability, aborting.\n");
dev_err(&pdev->dev, "Cannot find PCIX capability, aborting.\n");
rc = -EIO;
goto err_out_release;
}

if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
bp->flags |= USING_DAC_FLAG;
if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) {
dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"pci_set_consistent_dma_mask failed, aborting.\n");
rc = -EIO;
goto err_out_release;
}
}
else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) {
dev_printk(KERN_ERR, &pdev->dev,
"System does not support DMA, aborting.\n");
dev_err(&pdev->dev, "System does not support DMA, aborting.\n");
rc = -EIO;
goto err_out_release;
}
Expand All @@ -5643,8 +5639,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->regview = ioremap_nocache(dev->base_addr, mem_len);

if (!bp->regview) {
dev_printk(KERN_ERR, &pdev->dev,
"Cannot map register space, aborting.\n");
dev_err(&pdev->dev, "Cannot map register space, aborting.\n");
rc = -ENOMEM;
goto err_out_release;
}
Expand Down Expand Up @@ -5716,7 +5711,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
!(bp->flags & PCIX_FLAG)) {

dev_printk(KERN_ERR, &pdev->dev,
dev_err(&pdev->dev,
"5706 A1 can only be used in a PCIX bus, aborting.\n");
goto err_out_unmap;
}
Expand All @@ -5738,8 +5733,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)

if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) !=
BNX2_DEV_INFO_SIGNATURE_MAGIC) {
dev_printk(KERN_ERR, &pdev->dev,
"Firmware not running, aborting.\n");
dev_err(&pdev->dev, "Firmware not running, aborting.\n");
rc = -ENODEV;
goto err_out_unmap;
}
Expand Down Expand Up @@ -5901,8 +5895,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#endif

if ((rc = register_netdev(dev))) {
dev_printk(KERN_ERR, &pdev->dev,
"Cannot register net device\n");
dev_err(&pdev->dev, "Cannot register net device\n");
if (bp->regview)
iounmap(bp->regview);
pci_release_regions(pdev);
Expand Down
Loading

0 comments on commit a56cdb5

Please sign in to comment.