Suggested by Jiri Slaby.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
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;
}
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;
}
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;
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;
/* 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);
#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;
}
#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;
}
/* 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;
}
/* 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;
}
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");
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
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;
}
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;
}
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;
}
#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);
err = pci_enable_device(pdev);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
- "aborting.\n");
+ 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, "Cannot find proper PCI device "
+ dev_err(&pdev->dev, "Cannot find proper PCI device "
"base address, aborting.\n");
err = -ENODEV;
goto err_out_disable_pdev;
dev = alloc_etherdev(sizeof(*cp));
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_disable_pdev;
}
err = pci_request_regions(pdev, dev->name);
if (err) {
- 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_free_netdev;
}
pci_set_master(pdev);
if (pci_write_config_byte(pdev,
PCI_CACHE_LINE_SIZE,
cas_cacheline_size)) {
- dev_printk(KERN_ERR, &pdev->dev, "Could not set PCI cache "
+ dev_err(&pdev->dev, "Could not set PCI cache "
"line size\n");
goto err_write_cacheline;
}
err = pci_set_consistent_dma_mask(pdev,
DMA_64BIT_MASK);
if (err < 0) {
- dev_printk(KERN_ERR, &pdev->dev, "Unable to obtain 64-bit DMA "
+ dev_err(&pdev->dev, "Unable to obtain 64-bit DMA "
"for consistent allocations\n");
goto err_out_free_res;
}
} else {
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
- dev_printk(KERN_ERR, &pdev->dev, "No usable DMA configuration, "
+ dev_err(&pdev->dev, "No usable DMA configuration, "
"aborting.\n");
goto err_out_free_res;
}
/* give us access to cassini registers */
cp->regs = pci_iomap(pdev, 0, casreg_len);
if (cp->regs == 0UL) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot map device registers, aborting.\n");
goto err_out_free_res;
}
cp->casreg_len = casreg_len;
pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
&cp->block_dvma);
if (!cp->init_block) {
- dev_printk(KERN_ERR, &pdev->dev, "Cannot allocate init block, "
- "aborting.\n");
+ dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n");
goto err_out_iounmap;
}
dev->features |= NETIF_F_HIGHDMA;
if (register_netdev(dev)) {
- 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_free_consistent;
}
if (!request_region(pci_resource_start(pdev, 1),
pci_resource_len(pdev, 1), "eepro100")) {
- dev_printk (KERN_ERR, &pdev->dev,
- "eepro100: cannot reserve I/O ports\n");
+ dev_err(&pdev->dev, "eepro100: cannot reserve I/O ports\n");
goto err_out_none;
}
if (!request_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0), "eepro100")) {
- dev_printk (KERN_ERR, &pdev->dev,
- "eepro100: cannot reserve MMIO region\n");
+ dev_err(&pdev->dev, "eepro100: cannot reserve MMIO region\n");
goto err_out_free_pio_region;
}
ioaddr = pci_iomap(pdev, pci_bar, 0);
if (!ioaddr) {
- dev_printk (KERN_ERR, &pdev->dev, "eepro100: cannot remap IO\n");
+ dev_err(&pdev->dev, "eepro100: cannot remap IO\n");
goto err_out_free_mmio_region;
}
irq = pdev->irq;
if (pci_resource_len(pdev, 0) < EPIC_TOTAL_SIZE) {
- dev_printk(KERN_ERR, &pdev->dev, "no PCI region space\n");
+ dev_err(&pdev->dev, "no PCI region space\n");
ret = -ENODEV;
goto err_out_disable;
}
dev = alloc_etherdev(sizeof (*ep));
if (!dev) {
- dev_printk(KERN_ERR, &pdev->dev, "no memory for eth device\n");
+ dev_err(&pdev->dev, "no memory for eth device\n");
goto err_out_free_res;
}
SET_MODULE_OWNER(dev);
ioaddr = pci_resource_start (pdev, 1);
ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1));
if (!ioaddr) {
- dev_printk(KERN_ERR, &pdev->dev, "ioremap failed\n");
+ dev_err(&pdev->dev, "ioremap failed\n");
goto err_out_free_netdev;
}
#endif
int mii_status = mdio_read(dev, phy, MII_BMSR);
if (mii_status != 0xffff && mii_status != 0x0000) {
ep->phys[phy_idx++] = phy;
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"MII transceiver #%d control "
"%4.4x status %4.4x.\n",
phy, mdio_read(dev, phy, 0), mii_status);
if (phy_idx != 0) {
phy = ep->phys[0];
ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE);
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"Autonegotiation advertising %4.4x link "
"partner %4.4x.\n",
ep->mii.advertising, mdio_read(dev, phy, 5));
} else if ( ! (ep->chip_flags & NO_MII)) {
- dev_printk(KERN_WARNING, &pdev->dev,
+ dev_warn(&pdev->dev,
"***WARNING***: No MII transceiver found!\n");
/* Use the known PHY address of the EPII. */
ep->phys[0] = 3;
/* The lower four bits are the media type. */
if (duplex) {
ep->mii.force_media = ep->mii.full_duplex = 1;
- dev_printk(KERN_INFO, &pdev->dev,
- "Forced full duplex operation requested.\n");
+ dev_info(&pdev->dev, "Forced full duplex requested.\n");
}
dev->if_port = ep->default_port = option;
len = pci_resource_len(pdev, bar);
if (len < MIN_REGION_SIZE) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region size %ld too small, aborting\n", len);
return -ENODEV;
}
if (mii_status != 0xffff && mii_status != 0x0000) {
np->phys[phy_idx++] = phy;
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_info(&pdev->dev,
"MII PHY found at address %d, status "
"0x%4.4x.\n", phy, mii_status);
/* get phy type */
np->mii_cnt = phy_idx;
if (phy_idx == 0)
- dev_printk(KERN_WARNING, &pdev->dev,
+ dev_warn(&pdev->dev,
"MII PHY not found -- this device may "
"not operate correctly.\n");
} else {
np->mii.full_duplex = full_duplex[card_idx];
if (np->mii.full_duplex) {
- dev_printk(KERN_INFO, &pdev->dev,
- "Media type forced to Full Duplex.\n");
+ dev_info(&pdev->dev, "Media type forced to Full Duplex.\n");
/* 89/6/13 add, (begin) */
// if (np->PHYType==MarvellPHY)
if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
irq = pdev->irq;
if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "no I/O resource at PCI BAR #0\n");
+ dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n");
return -ENODEV;
}
if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "I/O resource 0x%x @ 0x%lx busy\n",
+ dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n",
NE_IO_EXTENT, ioaddr);
return -EBUSY;
}
/* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */
dev = alloc_ei_netdev();
if (!dev) {
- dev_printk (KERN_ERR, &pdev->dev,
- "cannot allocate ethernet device\n");
+ dev_err(&pdev->dev, "cannot allocate ethernet device\n");
goto err_out_free_res;
}
SET_MODULE_OWNER(dev);
while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
/* Limit wait: '2' avoids jiffy roll-over. */
if (jiffies - reset_start_time > 2) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Card failure (no reset ack).\n");
goto err_out_free_netdev;
}
} else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
using_dac = 0;
} else {
- dev_printk(KERN_WARNING, &pci_dev->dev,
- "pci_set_dma_mask failed!\n");
+ dev_warn(&pci_dev->dev, "pci_set_dma_mask failed!\n");
return -ENODEV;
}
err = pci_enable_device(pci_dev);
if (err) {
- dev_printk(KERN_INFO, &pci_dev->dev,
- "pci_enable_dev failed: %d\n", err);
+ dev_info(&pci_dev->dev, "pci_enable_dev failed: %d\n", err);
goto out_free;
}
err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED,
DRV_NAME, ndev);
if (err) {
- dev_printk(KERN_INFO, &pci_dev->dev,
- "unable to register irq %d, err %d\n",
+ dev_info(&pci_dev->dev, "unable to register irq %d, err %d\n",
pci_dev->irq, err);
goto out_disable;
}
rtnl_lock();
err = dev_alloc_name(ndev, ndev->name);
if (err < 0) {
- dev_printk(KERN_INFO, &pci_dev->dev,
- "unable to get netdev name: %d\n", err);
+ dev_info(&pci_dev->dev, "unable to get netdev name: %d\n", err);
goto out_free_irq;
}
/* dev zeroed in alloc_etherdev */
dev = alloc_etherdev (sizeof (*tp));
if (dev == NULL) {
- dev_printk (KERN_ERR, &pdev->dev,
- "unable to alloc new ethernet\n");
+ dev_err(&pdev->dev, "unable to alloc new ethernet\n");
DPRINTK ("EXIT, returning -ENOMEM\n");
return -ENOMEM;
}
/* 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;
}
/* 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;
}
/* check for weird/broken PCI region reporting */
if ((pio_len < NETDRV_MIN_IO_SIZE) ||
(mmio_len < NETDRV_MIN_IO_SIZE)) {
- dev_printk (KERN_ERR, &pdev->dev,
- "Invalid PCI region size(s), aborting\n");
+ dev_err(&pdev->dev, "Invalid PCI region size(s), aborting\n");
rc = -ENODEV;
goto err_out;
}
/* ioremap MMIO region */
ioaddr = ioremap (mmio_start, mmio_len);
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_free_res;
}
dev = alloc_etherdev(sizeof (*tp));
if (dev == NULL) {
if (netif_msg_drv(&debug))
- dev_printk(KERN_ERR, &pdev->dev,
- "unable to alloc new ethernet\n");
+ dev_err(&pdev->dev, "unable to alloc new ethernet\n");
goto err_out;
}
rc = pci_enable_device(pdev);
if (rc < 0) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev, "enable failure\n");
+ dev_err(&pdev->dev, "enable failure\n");
goto err_out_free_dev;
}
acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
} else {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"PowerManagement capability not found.\n");
}
/* make sure PCI base addr 1 is MMIO */
if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region #1 not an MMIO resource, aborting\n");
rc = -ENODEV;
goto err_out_mwi;
/* check for weird/broken PCI region reporting */
if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"Invalid PCI region size(s), aborting\n");
rc = -ENODEV;
goto err_out_mwi;
rc = pci_request_regions(pdev, MODULENAME);
if (rc < 0) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
- "could not request regions.\n");
+ dev_err(&pdev->dev, "could not request regions.\n");
goto err_out_mwi;
}
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc < 0) {
if (netif_msg_probe(tp))
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"DMA configuration failed.\n");
goto err_out_free_res;
}
ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
if (ioaddr == NULL) {
if (netif_msg_probe(tp))
- 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_free_res;
}
* can support more than MAX_UNITS.
*/
if (velocity_nics >= MAX_UNITS) {
- dev_printk(KERN_NOTICE, &pdev->dev, "already found %d NICs.\n",
+ dev_notice(&pdev->dev, "already found %d NICs.\n",
velocity_nics);
return -ENODEV;
}
dev = alloc_etherdev(sizeof(struct velocity_info));
if (!dev) {
- dev_printk(KERN_ERR, &pdev->dev, "allocate net device failed.\n");
+ dev_err(&pdev->dev, "allocate net device failed.\n");
goto out;
}
ret = pci_request_regions(pdev, VELOCITY_NAME);
if (ret < 0) {
- dev_printk(KERN_ERR, &pdev->dev, "No PCI resources.\n");
+ dev_err(&pdev->dev, "No PCI resources.\n");
goto err_disable;
}
vptr->memaddr = pci_resource_start(pdev, 1);
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_IO)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region #0 is not an I/O resource, aborting.\n");
return -EINVAL;
}
if ((pci_resource_flags(pdev, 1) & IORESOURCE_IO)) {
- dev_printk(KERN_ERR, &pdev->dev,
+ dev_err(&pdev->dev,
"region #1 is an I/O resource, aborting.\n");
return -EINVAL;
}
if (pci_resource_len(pdev, 1) < VELOCITY_IO_SIZE) {
- dev_printk(KERN_ERR, &pdev->dev, "region #1 is too small.\n");
+ dev_err(&pdev->dev, "region #1 is too small.\n");
return -EINVAL;
}
vptr->pdev = pdev;