use dev_printk() in some net drivers
Subsystems (2)
PATCH 1/1 use dev_printk() in some net drivers
commit 25a0324ef1c1b181c9d00f09837e8757875ee2a4
Author: Jeff Garzik <[email protected]> Date: Tue Jun 27 10:47:51 2006 -0400
[netdrvr] Use dev_printk() when ethernet interface isn't available
For messages prior to register_netdev(), prefer dev_printk() because that prints out both our driver name and our [PCI | whatever] bus id.
Updates: 8139{cp,too}, b44, bnx2, cassini, {eepro,epic}100, fealnx,
hamachi, ne2k-pci, ns83820, pci-skeleton, r8169.
drivers/net/8139cp.c | 36 +++++++++++++++++++++--------------- drivers/net/8139too.c | 41 +++++++++++++++++++++++++---------------- drivers/net/b44.c | 28 +++++++++++++++------------- drivers/net/bnx2.c | 37 ++++++++++++++++++++++--------------- drivers/net/cassini.c | 20 ++++++++++---------- drivers/net/eepro100.c | 8 +++++--- drivers/net/epic100.c | 23 ++++++++++++----------- drivers/net/fealnx.c | 17 +++++++++-------- drivers/net/hamachi.c | 3 ++- drivers/net/ne2k-pci.c | 12 ++++++++---- drivers/net/ns83820.c | 14 +++++++++----- drivers/net/pci-skeleton.c | 24 +++++++++++++++--------- drivers/net/r8169.c | 43 +++++++++++++++++++------------------------ 13 files changed, 172 insertions(+), 134 deletions(-)
25a0324ef1c1b181c9d00f09837e8757875ee2a4
drivers/net/8139cp.c +21 -15
@@ -1837,9 +1837,11 @@ #endifif (pdev->vendor ==PCI_VENDOR_ID_REALTEK && pdev->device ==PCI_DEVICE_ID_REALTEK_8139 && pci_rev <0x20 ) { - printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", - pci_name(pdev), pdev->vendor, pdev->device, pci_rev); - printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n"); +dev_printk (KERN_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" );return -ENODEV ; }
@@ -1877,14 +1879,14 @@ #endif pciaddr =pci_resource_start (pdev,1 );if (!pciaddr) { rc = -EIO ; - printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n", - pci_name(pdev)); +dev_printk (KERN_ERR , &pdev->dev,"no MMIO resource\n" ); goto err_out_res; }if (pci_resource_len (pdev,1 ) <CP_REGS_SIZE ) { rc = -EIO ; - printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n", - pci_resource_len(pdev, 1), pci_name(pdev)); +dev_printk (KERN_ERR , &pdev->dev, +"MMIO resource (%lx) too small\n" , +pci_resource_len (pdev,1 )); goto err_out_res; }
@@ -1898,14 +1900,15 @@ #endif rc =pci_set_dma_mask (pdev,DMA_32BIT_MASK );if (rc) { - printk(KERN_ERR PFX "No usable DMA configuration, " - "aborting.\n"); +dev_printk (KERN_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) { - printk(KERN_ERR PFX "No usable consistent DMA configuration, " - "aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"No usable consistent DMA configuration, " +"aborting.\n" ); goto err_out_res; } }
@@ -1916,8 +1919,9 @@ #endif regs =ioremap (pciaddr,CP_REGS_SIZE );if (!regs) { rc = -EIO ; - printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n", - pci_resource_len(pdev, 1), pciaddr, pci_name(pdev)); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot map PCI MMIO (%lx@%lx)\n" , +pci_resource_len (pdev,1 ), pciaddr); goto err_out_res; } dev->base_addr = (unsigned long ) regs;
@@ -1986,7 +1990,8 @@ #endif/* enable busmastering and memory-write-invalidate */ pci_set_master (pdev); -if (cp->wol_enabled)cp_set_d3_state (cp); +if (cp->wol_enabled) +cp_set_d3_state (cp);return 0 ;
@@ -2011,7 +2016,8 @@ static void cp_remove_one (struct pci_deBUG_ON (!dev);unregister_netdev (dev);iounmap (cp->regs); -if (cp->wol_enabled)pci_set_power_state (pdev,PCI_D0 ); +if (cp->wol_enabled) +pci_set_power_state (pdev,PCI_D0 );pci_release_regions (pdev);pci_clear_mwi (pdev);pci_disable_device (pdev);
drivers/net/8139too.c +25 -16
103 lines not on this page · raw message
drivers/net/b44.c +15 -13
@@ -2120,13 +2120,14 @@ static int __devinit b44_init_one(struct err =pci_enable_device (pdev);if (err) { - printk(KERN_ERR PFX "Cannot enable PCI device, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot enable PCI device, " "aborting.\n" );return err; }if (!(pci_resource_flags (pdev,0 ) &IORESOURCE_MEM )) { - printk(KERN_ERR PFX "Cannot find proper PCI device " +dev_printk (KERN_ERR , &pdev->dev, +"Cannot find proper PCI device " "base address, aborting.\n" ); err = -ENODEV ; goto err_out_disable_pdev;
@@ -2134,8 +2135,8 @@ static int __devinit b44_init_one(struct err =pci_request_regions (pdev,DRV_MODULE_NAME );if (err) { - printk(KERN_ERR PFX "Cannot obtain PCI resources, " - "aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot obtain PCI resources, aborting.\n" ); goto err_out_disable_pdev; }
@@ -2143,15 +2144,15 @@ static int __devinit b44_init_one(struct err =pci_set_dma_mask (pdev, (u64 )B44_DMA_MASK );if (err) { - printk(KERN_ERR PFX "No usable DMA configuration, " - "aborting.\n"); +dev_printk (KERN_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) { - printk(KERN_ERR PFX "No usable DMA configuration, " - "aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"No usable DMA configuration, aborting.\n" ); goto err_out_free_res; }
@@ -2160,7 +2161,8 @@ static int __devinit b44_init_one(struct dev =alloc_etherdev (sizeof (*bp));if (!dev) { - printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Etherdev alloc failed, aborting.\n" ); err = -ENOMEM ; goto err_out_free_res; }
@@ -2181,7 +2183,7 @@ static int __devinit b44_init_one(struct bp->regs =ioremap (b44reg_base, b44reg_len);if (bp->regs ==0UL ) { - printk(KERN_ERR PFX "Cannot map device registers, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot map device registers, " "aborting.\n" ); err = -ENOMEM ; goto err_out_free_dev;
@@ -2212,8 +2214,8 @@ #endif err =b44_get_invariants (bp);if (err) { - printk(KERN_ERR PFX "Problem fetching invariants of chip, " - "aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Problem fetching invariants of chip, aborting.\n" ); goto err_out_iounmap; }
@@ -2233,7 +2235,7 @@ #endif err =register_netdev (dev);if (err) { - printk(KERN_ERR PFX "Cannot register net device, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot register net device, " "aborting.\n" ); goto err_out_iounmap; }
drivers/net/bnx2.c +22 -15
@@ -5566,20 +5566,22 @@ bnx2_init_board(struct pci_dev *pdev, st/* enable device (incl. PCI PM wakeup), and bus-mastering */ rc =pci_enable_device (pdev);if (rc) { - printk(KERN_ERR PFX "Cannot enable PCI device, aborting."); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot enable PCI device, aborting." ); goto err_out; }if (!(pci_resource_flags (pdev,0 ) &IORESOURCE_MEM )) { - printk(KERN_ERR PFX "Cannot find PCI device base address, " - "aborting.\n"); +dev_printk (KERN_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) { - printk(KERN_ERR PFX "Cannot obtain PCI resources, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot obtain PCI resources, aborting.\n" ); goto err_out_disable; }
@@ -5587,15 +5589,16 @@ bnx2_init_board(struct pci_dev *pdev, st bp->pm_cap =pci_find_capability (pdev,PCI_CAP_ID_PM );if (bp->pm_cap ==0 ) { - printk(KERN_ERR PFX "Cannot find power management capability, " - "aborting.\n"); +dev_printk (KERN_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 ) { - printk(KERN_ERR PFX "Cannot find PCIX capability, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot find PCIX capability, aborting.\n" ); rc = -EIO ; goto err_out_release; }
@@ -5603,14 +5606,15 @@ bnx2_init_board(struct pci_dev *pdev, stif (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 ) { - printk(KERN_ERR PFX "pci_set_consistent_dma_mask " - "failed, aborting.\n"); +dev_printk (KERN_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 ) { - printk(KERN_ERR PFX "System does not support DMA, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"System does not support DMA, aborting.\n" ); rc = -EIO ; goto err_out_release; }
@@ -5630,7 +5634,8 @@ bnx2_init_board(struct pci_dev *pdev, st bp->regview =ioremap_nocache (dev->base_addr, mem_len);if (!bp->regview) { - printk(KERN_ERR PFX "Cannot map register space, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot map register space, aborting.\n" ); rc = -ENOMEM ; goto err_out_release; }
@@ -5702,8 +5707,8 @@ bnx2_init_board(struct pci_dev *pdev, stelse if ((CHIP_ID (bp) ==CHIP_ID_5706_A1 ) && !(bp->flags &PCIX_FLAG )) { - printk(KERN_ERR PFX "5706 A1 can only be used in a PCIX bus, " - "aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"5706 A1 can only be used in a PCIX bus, aborting.\n" ); goto err_out_unmap; }
@@ -5724,7 +5729,8 @@ bnx2_init_board(struct pci_dev *pdev, stif ((reg &BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK ) !=BNX2_DEV_INFO_SIGNATURE_MAGIC ) { - printk(KERN_ERR PFX "Firmware not running, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Firmware not running, aborting.\n" ); rc = -ENODEV ; goto err_out_unmap; }
@@ -5886,7 +5892,8 @@ #if defined(HAVE_POLL_CONTROLLER) || def#endif if ((rc =register_netdev (dev))) { - printk(KERN_ERR PFX "Cannot register net device\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Cannot register net device\n" );if (bp->regview)iounmap (bp->regview);pci_release_regions (pdev);
drivers/net/cassini.c +10 -10
@@ -4888,13 +4888,13 @@ static int __devinit cas_init_one(struct err =pci_enable_device (pdev);if (err) { - printk(KERN_ERR PFX "Cannot enable PCI device, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot enable PCI device, " "aborting.\n" );return err; }if (!(pci_resource_flags (pdev,0 ) &IORESOURCE_MEM )) { - printk(KERN_ERR PFX "Cannot find proper PCI device " +dev_printk (KERN_ERR , &pdev->dev,"Cannot find proper PCI device " "base address, aborting.\n" ); err = -ENODEV ; goto err_out_disable_pdev;
@@ -4902,7 +4902,7 @@ static int __devinit cas_init_one(struct dev =alloc_etherdev (sizeof (*cp));if (!dev) { - printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); +dev_printk (KERN_ERR , &pdev->dev,"Etherdev alloc failed, aborting.\n" ); err = -ENOMEM ; goto err_out_disable_pdev; }
@@ -4911,7 +4911,7 @@ static int __devinit cas_init_one(struct err =pci_request_regions (pdev, dev->name);if (err) { - printk(KERN_ERR PFX "Cannot obtain PCI resources, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot obtain PCI resources, " "aborting.\n" ); goto err_out_free_netdev; }
@@ -4942,7 +4942,7 @@ #if 1if (pci_write_config_byte (pdev,PCI_CACHE_LINE_SIZE , cas_cacheline_size)) { - printk(KERN_ERR PFX "Could not set PCI cache " +dev_printk (KERN_ERR , &pdev->dev,"Could not set PCI cache " "line size\n" ); goto err_write_cacheline; }
@@ -4956,7 +4956,7 @@ #endif err =pci_set_consistent_dma_mask (pdev,DMA_64BIT_MASK );if (err <0 ) { - printk(KERN_ERR PFX "Unable to obtain 64-bit DMA " +dev_printk (KERN_ERR , &pdev->dev,"Unable to obtain 64-bit DMA " "for consistent allocations\n" ); goto err_out_free_res; }
@@ -4964,7 +4964,7 @@ #endif }else { err =pci_set_dma_mask (pdev,DMA_32BIT_MASK );if (err) { - printk(KERN_ERR PFX "No usable DMA configuration, " +dev_printk (KERN_ERR , &pdev->dev,"No usable DMA configuration, " "aborting.\n" ); goto err_out_free_res; }
@@ -5024,7 +5024,7 @@ #endif/* give us access to cassini registers */ cp->regs =pci_iomap (pdev,0 , casreg_len);if (cp->regs ==0UL ) { - printk(KERN_ERR PFX "Cannot map device registers, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot map device registers, " "aborting.\n" ); goto err_out_free_res; }
@@ -5041,7 +5041,7 @@ #endifpci_alloc_consistent (pdev,sizeof (struct cas_init_block ), &cp->block_dvma);if (!cp->init_block) { - printk(KERN_ERR PFX "Cannot allocate init block, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot allocate init block, " "aborting.\n" ); goto err_out_iounmap; }
@@ -5086,7 +5086,7 @@ #endif dev->features |=NETIF_F_HIGHDMA ;if (register_netdev (dev)) { - printk(KERN_ERR PFX "Cannot register net device, " +dev_printk (KERN_ERR , &pdev->dev,"Cannot register net device, " "aborting.\n" ); goto err_out_free_consistent; }
drivers/net/eepro100.c +5 -3
@@ -556,12 +556,14 @@ #endifif (!request_region (pci_resource_start (pdev,1 ),pci_resource_len (pdev,1 ),"eepro100" )) { -printk (KERN_ERR "eepro100: cannot reserve I/O ports\n" ); +dev_printk (KERN_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" )) { -printk (KERN_ERR "eepro100: cannot reserve MMIO region\n" ); +dev_printk (KERN_ERR , &pdev->dev, +"eepro100: cannot reserve MMIO region\n" ); goto err_out_free_pio_region; }
@@ -574,7 +576,7 @@ #endif ioaddr =pci_iomap (pdev, pci_bar,0 );if (!ioaddr) { -printk (KERN_ERR "eepro100: cannot remap IO\n" ); +dev_printk (KERN_ERR , &pdev->dev,"eepro100: cannot remap IO\n" ); goto err_out_free_mmio_region; }
drivers/net/epic100.c +12 -11
@@ -423,8 +423,7 @@ #endif ((u16 *)dev->dev_addr)[i] =le16_to_cpu (inw (ioaddr +LAN0 + i*4 ));if (debug >2 ) { - printk(KERN_DEBUG DRV_NAME "(%s): EEPROM contents\n", - pci_name(pdev)); +dev_printk (KERN_DEBUG , &pdev->dev,"EEPROM contents:\n" );for (i =0 ; i <64 ; i++)printk (" %4.4x%s" ,read_eeprom (ioaddr, i), i %16 ==15 ?"\n" :"" );
@@ -446,21 +445,23 @@ #endifint mii_status =mdio_read (dev, phy,MII_BMSR );if (mii_status !=0xffff && mii_status !=0x0000 ) { ep->phys[phy_idx++] = phy; - printk(KERN_INFO DRV_NAME "(%s): MII transceiver #%d control " -"%4.4x status %4.4x.\n" , - pci_name(pdev), phy, mdio_read(dev, phy, 0), mii_status); +dev_printk (KERN_INFO , &pdev->dev, +"MII transceiver #%d control " +"%4.4x status %4.4x.\n" , + phy,mdio_read (dev, phy,0 ), mii_status); } } ep->mii_phy_cnt = phy_idx;if (phy_idx !=0 ) { phy = ep->phys[0 ]; ep->mii.advertising =mdio_read (dev, phy,MII_ADVERTISE ); - printk(KERN_INFO DRV_NAME "(%s): Autonegotiation advertising %4.4x link " +dev_printk (KERN_INFO , &pdev->dev, +"Autonegotiation advertising %4.4x link " "partner %4.4x.\n" , - pci_name(pdev), ep->mii.advertising, mdio_read(dev, phy, 5)); + ep->mii.advertising,mdio_read (dev, phy,5 )); }else if ( ! (ep->chip_flags &NO_MII )) { - printk(KERN_WARNING DRV_NAME "(%s): ***WARNING***: No MII transceiver found!\n", - pci_name(pdev)); +dev_printk (KERN_WARNING , &pdev->dev, +"***WARNING***: No MII transceiver found!\n" );/* Use the known PHY address of the EPII. */ ep->phys[0 ] =3 ; }
@@ -475,8 +476,8 @@ #endif/* The lower four bits are the media type. */ if (duplex) { ep->mii.force_media = ep->mii.full_duplex =1 ; - printk(KERN_INFO DRV_NAME "(%s): Forced full duplex operation requested.\n", - pci_name(pdev)); +dev_printk (KERN_INFO , &pdev->dev, +"Forced full duplex operation requested.\n" ); } dev->if_port = ep->default_port = option;
drivers/net/fealnx.c +9 -8
@@ -578,9 +578,9 @@ #endifif (mii_status !=0xffff && mii_status !=0x0000 ) { np->phys[phy_idx++] = phy; -printk (KERN_INFO -"%s: MII PHY found at address %d, status " -"0x%4.4x.\n" , dev->name, phy, mii_status); +dev_printk (KERN_INFO , &pdev->dev, +"MII PHY found at address %d, status " +"0x%4.4x.\n" , phy, mii_status);/* get phy type */ {unsigned int data;
@@ -603,10 +603,10 @@ #endif } np->mii_cnt = phy_idx; -if (phy_idx ==0 ) { -printk (KERN_WARNING "%s: MII PHY not found -- this device may " -"not operate correctly.\n" , dev->name); - } +if (phy_idx ==0 ) +dev_printk (KERN_WARNING , &pdev->dev, +"MII PHY not found -- this device may " +"not operate correctly.\n" ); }else { np->phys[0 ] =32 ;/* 89/6/23 add, (begin) */
@@ -632,7 +632,8 @@ #endif np->mii.full_duplex = full_duplex[card_idx];if (np->mii.full_duplex) { -printk (KERN_INFO "%s: Media type forced to Full Duplex.\n" , dev->name); +dev_printk (KERN_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)) {
drivers/net/hamachi.c +2 -1
@@ -601,7 +601,8 @@ #endifpci_set_master (pdev); i =pci_request_regions (pdev,DRV_NAME ); -if (i)return i; +if (i) +return i; irq = pdev->irq; ioaddr =ioremap (base,0x400 );
drivers/net/ne2k-pci.c +8 -4
@@ -231,12 +231,14 @@ #endif irq = pdev->irq;if (!ioaddr || ((pci_resource_flags (pdev,0 ) &IORESOURCE_IO ) ==0 )) { - printk (KERN_ERR PFX "no I/O resource at PCI BAR #0\n"); +dev_printk (KERN_ERR , &pdev->dev, +"no I/O resource at PCI BAR #0\n" );return -ENODEV ; }if (request_region (ioaddr,NE_IO_EXTENT ,DRV_NAME ) ==NULL ) { - printk (KERN_ERR PFX "I/O resource 0x%x @ 0x%lx busy\n", +dev_printk (KERN_ERR , &pdev->dev, +"I/O resource 0x%x @ 0x%lx busy\n" ,NE_IO_EXTENT , ioaddr);return -EBUSY ; }
@@ -263,7 +265,8 @@ #endif/* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ dev =alloc_ei_netdev ();if (!dev) { - printk (KERN_ERR PFX "cannot allocate ethernet device\n"); +dev_printk (KERN_ERR , &pdev->dev, +"cannot allocate ethernet device\n" ); goto err_out_free_res; }SET_MODULE_OWNER (dev);
@@ -281,7 +284,8 @@ #endifwhile ((inb (ioaddr +EN0_ISR ) &ENISR_RESET ) ==0 )/* Limit wait: '2' avoids jiffy roll-over. */ if (jiffies - reset_start_time >2 ) { - printk(KERN_ERR PFX "Card failure (no reset ack).\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Card failure (no reset ack).\n" ); goto err_out_free_netdev; }
drivers/net/ns83820.c +9 -5
@@ -1833,7 +1833,8 @@ static int __devinit ns83820_init_one(st }else if (!pci_set_dma_mask (pci_dev,DMA_32BIT_MASK )) { using_dac =0 ; }else { -printk (KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n" ); +dev_printk (KERN_WARNING , &pci_dev->dev, +"pci_set_dma_mask failed!\n" );return -ENODEV ; }
@@ -1856,7 +1857,8 @@ static int __devinit ns83820_init_one(st err =pci_enable_device (pci_dev);if (err) { -printk (KERN_INFO "ns83820: pci_enable_dev failed: %d\n" , err); +dev_printk (KERN_INFO , &pci_dev->dev, +"pci_enable_dev failed: %d\n" , err); goto out_free; }
@@ -1885,8 +1887,9 @@ static int __devinit ns83820_init_one(st err =request_irq (pci_dev->irq, ns83820_irq,SA_SHIRQ ,DRV_NAME , ndev);if (err) { -printk (KERN_INFO "ns83820: unable to register irq %d\n" , - pci_dev->irq); +dev_printk (KERN_INFO , &pci_dev->dev, +"unable to register irq %d, err %d\n" , + pci_dev->irq, err); goto out_disable; }
@@ -1900,7 +1903,8 @@ static int __devinit ns83820_init_one(strtnl_lock (); err =dev_alloc_name (ndev, ndev->name);if (err <0 ) { -printk (KERN_INFO "ns83820: unable to get netdev name: %d\n" , err); +dev_printk (KERN_INFO , &pci_dev->dev, +"unable to get netdev name: %d\n" , err); goto out_free_irq; }
drivers/net/pci-skeleton.c +15 -9
@@ -602,7 +602,8 @@ static int __devinit netdrv_init_board (/* dev zeroed in alloc_etherdev */ dev =alloc_etherdev (sizeof (*tp));if (dev ==NULL ) { - printk (KERN_ERR PFX "unable to alloc new ethernet\n"); +dev_printk (KERN_ERR , &pdev->dev, +"unable to alloc new ethernet\n" );DPRINTK ("EXIT, returning -ENOMEM\n" );return -ENOMEM ; }
@@ -632,14 +633,16 @@ static int __devinit netdrv_init_board (/* make sure PCI base addr 0 is PIO */ if (!(pio_flags &IORESOURCE_IO )) { - printk (KERN_ERR PFX "region #0 not a PIO resource, aborting\n"); +dev_printk (KERN_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 )) { - printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n"); +dev_printk (KERN_ERR , &pdev->dev, +"region #1 not an MMIO resource, aborting\n" ); rc = -ENODEV ; goto err_out; }
@@ -647,12 +650,13 @@ static int __devinit netdrv_init_board (/* check for weird/broken PCI region reporting */ if ((pio_len <NETDRV_MIN_IO_SIZE ) || (mmio_len <NETDRV_MIN_IO_SIZE )) { - printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); +dev_printk (KERN_ERR , &pdev->dev, +"Invalid PCI region size(s), aborting\n" ); rc = -ENODEV ; goto err_out; } - rc =pci_request_regions (pdev,"pci-skeleton" ); + rc =pci_request_regions (pdev,MODNAME );if (rc) goto err_out;
@@ -664,7 +668,8 @@ #else/* ioremap MMIO region */ ioaddr =ioremap (mmio_start, mmio_len);if (ioaddr ==NULL ) { - printk (KERN_ERR PFX "cannot remap MMIO, aborting\n"); +dev_printk (KERN_ERR , &pdev->dev, +"cannot remap MMIO, aborting\n" ); rc = -EIO ; goto err_out_free_res; }
@@ -700,9 +705,10 @@ #endif /* !USE_IO_OPS */ }/* if unknown chip, assume array element #0, original RTL-8139 in this case */ - printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8139\n", - pci_name(pdev)); - printk (KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n", pci_name(pdev), NETDRV_R32 (TxConfig)); +dev_printk (KERN_DEBUG , &pdev->dev, +"unknown chip version, assuming RTL-8139\n" ); +dev_printk (KERN_DEBUG , &pdev->dev,"TxConfig = 0x%lx\n" , +NETDRV_R32 (TxConfig)); tp->chipset =0 ; match:
drivers/net/r8169.c +19 -24
99 lines not on this page · raw message
Jeff Garzik napsal(a):
Quoted 39 lines
commit
25a0324ef1c1b181c9d00f09837e8757875ee2a4Author: Jeff Garzik <[email protected]> Date: Tue Jun 27 10:47:51 2006 -0400[netdrvr] Use
dev_printk()when ethernet interface isn't availableFor messages prior to
register_netdev(), preferdev_printk()because that prints out both our driver name and our [PCI | whatever] bus id.Updates: 8139{cp,too}, b44, bnx2, cassini, {eepro,epic}100, fealnx,
hamachi, ne2k-pci, ns83820, pci-skeleton, r8169.Signed-off-by Jeff Garzik <[email protected]>drivers/net/8139cp.c | 36 +++++++++++++++++++++--------------- drivers/net/8139too.c | 41 +++++++++++++++++++++++++---------------- drivers/net/b44.c | 28 +++++++++++++++------------- drivers/net/bnx2.c | 37 ++++++++++++++++++++++--------------- drivers/net/cassini.c | 20 ++++++++++---------- drivers/net/eepro100.c | 8 +++++--- drivers/net/epic100.c | 23 ++++++++++++----------- drivers/net/fealnx.c | 17 +++++++++-------- drivers/net/hamachi.c | 3 ++- drivers/net/ne2k-pci.c | 12 ++++++++---- drivers/net/ns83820.c | 14 +++++++++----- drivers/net/pci-skeleton.c | 24 +++++++++++++++--------- drivers/net/r8169.c | 43 +++++++++++++++++++------------------------ 13 files changed, 172 insertions(+), 134 deletions(-)
25a0324ef1c1b181c9d00f09837e8757875ee2a4drivers/net/8139cp.c +0
-1@@ -1837,9 +1837,11 @@ #endifif (pdev->vendor ==PCI_VENDOR_ID_REALTEK && pdev->device ==PCI_DEVICE_ID_REALTEK_8139 && pci_rev <0x20 ) { - printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
drivers/net/8139cp.c #endif · line 1847
Quoted 10 lines
drivers/net/8139cp.c +5
-2- pci_name(pdev), pdev->vendor, pdev->device, pci_rev); - printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n"); +dev_printk (KERN_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" );return -ENODEV ; }
Don't you consider to use s#dev_printk(KERN_ERR, #dev_err(# macro?
regards,
Signature · 3 lines
Jiri Slaby www.fi.muni.cz/~xslaby ~\-/~ [email protected] ~\-/~ B67499670407CE62ACC8 22A032CC55C339D47A7E
Quoted 1 line · Jiri Slaby
Don't you consider to use s#dev_printk(KERN_ERR, #dev_err(# macro?
Why, yes. I had forgotten about those, thanks.
Jeff
Quoted 1 line · Jiri Slaby
Don't you consider to use s#dev_printk(KERN_ERR, #dev_err(# macro?
Done.
Jeff
685aa11f7f1de42802cb0a8d5816c1efb08f65cd
drivers/net/8139cp.c +7 -10
@@ -1837,11 +1837,10 @@ #endifif (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 ; }
@@ -1879,13 +1878,12 @@ #endif 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 (%lx) too small\n" , +dev_err (&pdev->dev,"MMIO resource (%lx) too small\n" ,pci_resource_len (pdev,1 )); goto err_out_res; }
@@ -1900,13 +1898,13 @@ #endif 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;
@@ -1919,8 +1917,7 @@ #endif regs =ioremap (pciaddr,CP_REGS_SIZE );if (!regs) { rc = -EIO ; -dev_printk (KERN_ERR , &pdev->dev, -"Cannot map PCI MMIO (%lx@%lx)\n" , +dev_err (&pdev->dev,"Cannot map PCI MMIO (%lx@%lx)\n" ,pci_resource_len (pdev,1 ), pciaddr); goto err_out_res; }
drivers/net/8139too.c +10 -17
@@ -769,8 +769,7 @@ static int __devinit rtl8139_init_board/* 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);
@@ -802,29 +801,25 @@ static int __devinit rtl8139_init_board#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; }
@@ -841,7 +836,7 @@ #endif#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; }
@@ -852,8 +847,7 @@ #else/* 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; }
@@ -867,8 +861,7 @@ #endif /* USE_IO_OPS *//* 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; }
@@ -962,10 +955,10 @@ #endifif (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" ); }
drivers/net/b44.c +9 -14
@@ -2120,13 +2120,13 @@ static int __devinit b44_init_one(struct 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 ;
@@ -2135,7 +2135,7 @@ static int __devinit b44_init_one(struct 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; }
@@ -2144,15 +2144,13 @@ static int __devinit b44_init_one(struct 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; }
@@ -2161,8 +2159,7 @@ static int __devinit b44_init_one(struct 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; }
@@ -2183,8 +2180,7 @@ static int __devinit b44_init_one(struct 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; }
@@ -2214,7 +2210,7 @@ #endif 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; }
@@ -2235,8 +2231,7 @@ #endif 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; }
drivers/net/bnx2.c +11 -18
@@ -5566,13 +5566,12 @@ bnx2_init_board(struct pci_dev *pdev, st/* 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;
@@ -5580,8 +5579,7 @@ bnx2_init_board(struct pci_dev *pdev, st 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; }
@@ -5589,7 +5587,7 @@ bnx2_init_board(struct pci_dev *pdev, st 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;
@@ -5597,8 +5595,7 @@ bnx2_init_board(struct pci_dev *pdev, st 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; }
@@ -5606,15 +5603,14 @@ bnx2_init_board(struct pci_dev *pdev, stif (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; }
@@ -5634,8 +5630,7 @@ bnx2_init_board(struct pci_dev *pdev, st 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; }
@@ -5707,7 +5702,7 @@ bnx2_init_board(struct pci_dev *pdev, stelse 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; }
@@ -5729,8 +5724,7 @@ bnx2_init_board(struct pci_dev *pdev, stif ((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; }
@@ -5892,8 +5886,7 @@ #if defined(HAVE_POLL_CONTROLLER) || def#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);
drivers/net/cassini.c +10 -15
@@ -4888,13 +4888,12 @@ static int __devinit cas_init_one(struct 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;
@@ -4902,7 +4901,7 @@ static int __devinit cas_init_one(struct 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; }
@@ -4911,8 +4910,7 @@ static int __devinit cas_init_one(struct 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);
@@ -4942,7 +4940,7 @@ #if 1if (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; }
@@ -4956,7 +4954,7 @@ #endif 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; }
@@ -4964,7 +4962,7 @@ #endif }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; }
@@ -5024,8 +5022,7 @@ #endif/* 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;
@@ -5041,8 +5038,7 @@ #endifpci_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; }
@@ -5086,8 +5082,7 @@ #endif 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; }
drivers/net/eepro100.c +3 -5
@@ -556,14 +556,12 @@ #endifif (!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; }
@@ -576,7 +574,7 @@ #endif 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; }
drivers/net/epic100.c +7 -8
@@ -336,7 +336,7 @@ #endif 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; }
@@ -351,7 +351,7 @@ #endif 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);
@@ -363,7 +363,7 @@ #else 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
@@ -445,7 +445,7 @@ #endifint 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);
@@ -455,12 +455,12 @@ #endifif (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 ;
@@ -476,8 +476,7 @@ #endif/* 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;
drivers/net/fealnx.c +4 -5
@@ -505,7 +505,7 @@ #endif 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 ; }
@@ -578,7 +578,7 @@ #endifif (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 */
@@ -604,7 +604,7 @@ #endif 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 {
@@ -632,8 +632,7 @@ #endif 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)) {
drivers/net/ne2k-pci.c +4 -7
@@ -231,14 +231,12 @@ #endif 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 ; }
@@ -265,8 +263,7 @@ #endif/* 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);
@@ -284,7 +281,7 @@ #endifwhile ((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; }
drivers/net/ns83820.c +4 -8
@@ -1833,8 +1833,7 @@ static int __devinit ns83820_init_one(st }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 ; }
@@ -1857,8 +1856,7 @@ static int __devinit ns83820_init_one(st 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; }
@@ -1887,8 +1885,7 @@ static int __devinit ns83820_init_one(st err =request_irq (pci_dev->irq, ns83820_irq,SA_SHIRQ ,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; }
@@ -1903,8 +1900,7 @@ static int __devinit ns83820_init_one(strtnl_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; }
drivers/net/pci-skeleton.c +5 -10
@@ -602,8 +602,7 @@ static int __devinit netdrv_init_board (/* 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 ; }
@@ -633,16 +632,14 @@ static int __devinit netdrv_init_board (/* 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; }
@@ -650,8 +647,7 @@ static int __devinit netdrv_init_board (/* 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; }
@@ -668,8 +664,7 @@ #else/* 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; }
drivers/net/r8169.c +8 -11
@@ -1406,8 +1406,7 @@ rtl8169_init_board(struct pci_dev *pdev, 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; }
@@ -1420,7 +1419,7 @@ rtl8169_init_board(struct pci_dev *pdev, 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; }
@@ -1437,14 +1436,14 @@ rtl8169_init_board(struct pci_dev *pdev, 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;
@@ -1452,7 +1451,7 @@ rtl8169_init_board(struct pci_dev *pdev,/* 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;
@@ -1461,8 +1460,7 @@ rtl8169_init_board(struct pci_dev *pdev, 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; }
@@ -1476,7 +1474,7 @@ rtl8169_init_board(struct pci_dev *pdev, 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; }
@@ -1488,8 +1486,7 @@ rtl8169_init_board(struct pci_dev *pdev, 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; }
drivers/net/via-velocity.c +6 -6
@@ -697,14 +697,14 @@ static int __devinit velocity_found1(str* 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; }
@@ -741,7 +741,7 @@ static int __devinit velocity_found1(str 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; }
@@ -897,19 +897,19 @@ static int __devinit velocity_get_pci_in 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;