wan: Use current logging forms
Subsystems (7)
cover wan: Use current logging forms
Joe Perches (8):
generic_hdlc: Update to current logging forms
cosa: Update to current logging forms
cyclom: Update to current logging forms
frame relay dlci/frad: Update to current logging forms
dscc4: Update to current logging forms
farsync: Update to current logging forms
ixp4xx_hss: Update to current logging forms
wan: Update to current logging forms
drivers/net/wan/c101.c | 30 +++--- drivers/net/wan/cosa.c | 226 +++++++++++++++++++--------------------- drivers/net/wan/cycx_drv.c | 81 +++++++-------- drivers/net/wan/cycx_main.c | 31 +++--- drivers/net/wan/cycx_x25.c | 177 +++++++++++++++----------------- drivers/net/wan/dlci.c | 22 +++-- drivers/net/wan/dscc4.c | 80 +++++++-------- drivers/net/wan/farsync.c | 7 +- drivers/net/wan/hd64570.c | 8 +- drivers/net/wan/hd64572.c | 8 +- drivers/net/wan/hdlc.c | 16 ++-- drivers/net/wan/hdlc_cisco.c | 21 ++--- drivers/net/wan/hdlc_fr.c | 96 ++++++++---------- drivers/net/wan/hdlc_ppp.c | 9 +- drivers/net/wan/hdlc_x25.c | 12 +-- drivers/net/wan/hostess_sv11.c | 11 +- drivers/net/wan/ixp4xx_hss.c | 28 +++--- drivers/net/wan/lapbether.c | 18 ++-- drivers/net/wan/n2.c | 42 ++++---- drivers/net/wan/pc300_drv.c | 4 +- drivers/net/wan/pc300too.c | 36 +++---- drivers/net/wan/pci200syn.c | 29 +++--- drivers/net/wan/sbni.c | 67 ++++++------ drivers/net/wan/sdla.c | 52 ++++++---- drivers/net/wan/sealevel.c | 11 +- drivers/net/wan/wanxl.c | 90 ++++++++--------- drivers/net/wan/x25_asy.c | 47 ++++---- drivers/net/wan/z85230.c | 34 +++--- 28 files changed, 620 insertions(+), 673 deletions(-)
Signature · 1 line
1.7.6.rc1
PATCH 1/8 generic_hdlc: Update to current logging forms
Use pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/c101.c | 30 +++++++------- drivers/net/wan/hd64570.c | 8 ++-- drivers/net/wan/hd64572.c | 8 ++-- drivers/net/wan/hdlc.c | 16 ++++--- drivers/net/wan/hdlc_cisco.c | 21 ++++------ drivers/net/wan/hdlc_fr.c | 96 +++++++++++++++++++----------------------- drivers/net/wan/hdlc_ppp.c | 9 ++-- drivers/net/wan/hdlc_x25.c | 12 ++--- drivers/net/wan/n2.c | 42 +++++++++--------- drivers/net/wan/pc300too.c | 36 +++++++-------- drivers/net/wan/pci200syn.c | 29 ++++++------- drivers/net/wan/wanxl.c | 90 ++++++++++++++++++--------------------- 12 files changed, 186 insertions(+), 211 deletions(-)
drivers/net/wan/c101.c +15 -15
@@ -14,6 +14,8 @@* Moxa C101 User's Manual */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/capability.h>
@@ -313,44 +315,44 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)int result;if (irq<3 || irq>15 || irq ==6 )/* FIXME */ { -printk (KERN_ERR "c101: invalid IRQ value\n" ); +pr_err ("invalid IRQ value\n" );return -ENODEV ; }if (winbase <0xC0000 || winbase >0xDFFFF || (winbase &0x3FFF ) !=0 ) { -printk (KERN_ERR "c101: invalid RAM value\n" ); +pr_err ("invalid RAM value\n" );return -ENODEV ; } card =kzalloc (sizeof (card_t),GFP_KERNEL );if (card ==NULL ) { -printk (KERN_ERR "c101: unable to allocate memory\n" ); +pr_err ("unable to allocate memory\n" );return -ENOBUFS ; } card->dev =alloc_hdlcdev (card);if (!card->dev) { -printk (KERN_ERR "c101: unable to allocate memory\n" ); +pr_err ("unable to allocate memory\n" );kfree (card);return -ENOBUFS ; }if (request_irq (irq, sca_intr,0 , devname, card)) { -printk (KERN_ERR "c101: could not allocate IRQ\n" ); +pr_err ("could not allocate IRQ\n" );c101_destroy_card (card);return -EBUSY ; } card->irq = irq;if (!request_mem_region (winbase,C101_MAPPED_RAM_SIZE , devname)) { -printk (KERN_ERR "c101: could not request RAM window\n" ); +pr_err ("could not request RAM window\n" );c101_destroy_card (card);return -EBUSY ; } card->phy_winbase = winbase; card->win0base =ioremap (winbase,C101_MAPPED_RAM_SIZE );if (!card->win0base) { -printk (KERN_ERR "c101: could not map I/O address\n" ); +pr_err ("could not map I/O address\n" );c101_destroy_card (card);return -EFAULT ; }
@@ -381,7 +383,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) result =register_hdlc_device (dev);if (result) { -printk (KERN_WARNING "c101: unable to register hdlc device\n" ); +pr_warn ("unable to register hdlc device\n" );c101_destroy_card (card);return result; }
@@ -389,10 +391,8 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)sca_init_port (card);/* Set up C101 memory */ set_carrier (card); -printk (KERN_INFO "%s: Moxa C101 on IRQ%u," -" using %u TX + %u RX packets rings\n" , - dev->name, card->irq, - card->tx_ring_buffers, card->rx_ring_buffers); +netdev_info (dev,"Moxa C101 on IRQ%u, using %u TX + %u RX packets rings\n" , + card->irq, card->tx_ring_buffers, card->rx_ring_buffers); *new_card = card; new_card = &card->next_card;
@@ -405,12 +405,12 @@ static int __init c101_init(void) {if (hw ==NULL ) {#ifdef MODULE -printk (KERN_INFO "c101: no card initialized\n" ); +pr_info ("no card initialized\n" );#endif return -EINVAL ;/* no parameters specified, abort */ } -printk (KERN_INFO "%s\n" , version); +pr_info ("%s\n" , version); do { unsigned long irq, ram;
@@ -428,7 +428,7 @@ static int __init c101_init(void)return first_card ?0 : -EINVAL ; }while (*hw++ ==':' ); -printk (KERN_ERR "c101: invalid hardware parameters\n" ); +pr_err ("invalid hardware parameters\n" );return first_card ?0 : -EINVAL ; }
drivers/net/wan/hd64570.c +4 -4
@@ -582,8 +582,8 @@ static void sca_dump_rings(struct net_device *dev)sca_in (DSR_RX (phy_node (port)), card), port->rxin, sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in");for (cnt =0 ; cnt <port_to_card (port)->rx_ring_buffers; cnt++) -printk (" %02X" ,readb (&(desc_address (port, cnt,0 )->stat))); -printk (KERN_CONT "\n" ); +pr_cont (" %02X" ,readb (&(desc_address (port, cnt,0 )->stat))); +pr_cont ("\n" ); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive",
@@ -593,8 +593,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_TX(phy_node(port)), card) & DSR_DE ? "" : "in");for (cnt =0 ; cnt <port_to_card (port)->tx_ring_buffers; cnt++) -printk (" %02X" ,readb (&(desc_address (port, cnt,1 )->stat))); -printk ("\n" ); +pr_cont (" %02X" ,readb (&(desc_address (port, cnt,1 )->stat))); +pr_cont ("\n" ); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x, ST: %02x %02x %02x %02x," " FST: %02x CST: %02x %02x\n",
drivers/net/wan/hd64572.c +4 -4
@@ -530,8 +530,8 @@ static void sca_dump_rings(struct net_device *dev)sca_in (DSR_RX (port->chan), card), port->rxin, sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in");for (cnt =0 ; cnt < port->card->rx_ring_buffers; cnt++) -printk (" %02X" ,readb (&(desc_address (port, cnt,0 )->stat))); -printk (KERN_CONT "\n" ); +pr_cont (" %02X" ,readb (&(desc_address (port, cnt,0 )->stat))); +pr_cont ("\n" ); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive",
@@ -541,8 +541,8 @@ static void sca_dump_rings(struct net_device *dev) sca_in(DSR_TX(port->chan), card) & DSR_DE ? "" : "in");for (cnt =0 ; cnt < port->card->tx_ring_buffers; cnt++) -printk (" %02X" ,readb (&(desc_address (port, cnt,1 )->stat))); -printk ("\n" ); +pr_cont (" %02X" ,readb (&(desc_address (port, cnt,1 )->stat))); +pr_cont ("\n" ); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x," " ST: %02x %02x %02x %02x %02x, FST: %02x CST: %02x %02x\n",
drivers/net/wan/hdlc.c +9 -7
@@ -22,6 +22,8 @@* - proto->start() and stop() are called with spin_lock_irq held. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/hdlc.h> #include <linux/if_arp.h>
@@ -130,10 +132,10 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, goto carrier_exit;if (hdlc->carrier) { -printk (KERN_INFO "%s: Carrier detected\n" , dev->name); +netdev_info (dev,"Carrier detected\n" );hdlc_proto_start (dev); }else { -printk (KERN_INFO "%s: Carrier lost\n" , dev->name); +netdev_info (dev,"Carrier lost\n" );hdlc_proto_stop (dev); }
@@ -165,10 +167,10 @@ int hdlc_open(struct net_device *dev)spin_lock_irq (&hdlc->state_lock);if (hdlc->carrier) { -printk (KERN_INFO "%s: Carrier detected\n" , dev->name); +netdev_info (dev,"Carrier detected\n" );hdlc_proto_start (dev); }else -printk (KERN_INFO "%s: No carrier\n" , dev->name); +netdev_info (dev,"No carrier\n" ); hdlc->open =1 ;
@@ -281,8 +283,8 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,if (size)if ((dev_to_hdlc (dev)->state =kmalloc (size,GFP_KERNEL )) ==NULL ) { -printk (KERN_WARNING "Memory squeeze on" -" hdlc_proto_attach()\n" ); +netdev_warn (dev, +"Memory squeeze on hdlc_proto_attach()\n" );module_put (proto->module);return -ENOBUFS ; }
@@ -363,7 +365,7 @@ static int __init hdlc_module_init(void) {int result; -printk (KERN_INFO "%s\n" , version); +pr_info ("%s\n" , version);if ((result =register_netdevice_notifier (&hdlc_notifier)) !=0 )return result;dev_add_pack (&hdlc_packet_type);
drivers/net/wan/hdlc_cisco.c +8 -13
@@ -103,9 +103,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type, skb =dev_alloc_skb (sizeof (struct hdlc_header ) +sizeof (struct cisco_packet ));if (!skb) { -printk (KERN_WARNING -"%s: Memory squeeze on cisco_keepalive_send()\n" , - dev->name); +netdev_warn (dev,"Memory squeeze on cisco_keepalive_send()\n" );return ; }skb_reserve (skb,4 );
@@ -181,8 +179,8 @@ static int cisco_rx(struct sk_buff *skb) CISCO_PACKET_LEN) && (skb->len != sizeof(struct hdlc_header) + CISCO_BIG_PACKET_LEN)) { -printk (KERN_INFO "%s: Invalid length of Cisco control" -" packet (%d bytes)\n" , dev->name, skb->len); +netdev_info (dev,"Invalid length of Cisco control packet (%d bytes)\n" , + skb->len); goto rx_error; }
@@ -217,8 +215,7 @@ static int cisco_rx(struct sk_buff *skb)return NET_RX_SUCCESS ;case CISCO_ADDR_REPLY : -printk (KERN_INFO "%s: Unexpected Cisco IP address " -"reply\n" , dev->name); +netdev_info (dev,"Unexpected Cisco IP address reply\n" ); goto rx_error;case CISCO_KEEPALIVE_REQ :
@@ -235,9 +232,8 @@ static int cisco_rx(struct sk_buff *skb) min = sec /60 ; sec -= min *60 ; hrs = min /60 ; min -= hrs *60 ; days = hrs /24 ; hrs -= days *24 ; -printk (KERN_INFO "%s: Link up (peer " -"uptime %ud%uh%um%us)\n" , - dev->name, days, hrs, min, sec); +netdev_info (dev,"Link up (peer uptime %ud%uh%um%us)\n" , + days, hrs, min, sec);netif_dormant_off (dev); st->up =1 ; }
@@ -249,8 +245,7 @@ static int cisco_rx(struct sk_buff *skb) }/* switch (keepalive type) */ }/* switch (protocol) */ -printk (KERN_INFO "%s: Unsupported protocol %x\n" , dev->name, -ntohs (data->protocol)); +netdev_info (dev,"Unsupported protocol %x\n" ,ntohs (data->protocol));dev_kfree_skb_any (skb);return NET_RX_DROP ;
@@ -272,7 +267,7 @@ static void cisco_timer(unsigned long arg)if (st->up &&time_after (jiffies, st->last_poll + st->settings.timeout *HZ )) { st->up =0 ; -printk (KERN_INFO "%s: Link down\n" , dev->name); +netdev_info (dev,"Link down\n" );netif_dormant_on (dev); }
drivers/net/wan/hdlc_fr.c +43 -53
218 lines not on this page · raw message
drivers/net/wan/hdlc_ppp.c +4 -5
@@ -223,8 +223,7 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code, skb =dev_alloc_skb (sizeof (struct hdlc_header ) +sizeof (struct cp_header ) + magic_len + len);if (!skb) { -printk (KERN_WARNING "%s: out of memory in ppp_tx_cp()\n" , - dev->name); +netdev_warn (dev,"out of memory in ppp_tx_cp()\n" );return ; }skb_reserve (skb,sizeof (struct hdlc_header ));
@@ -345,7 +344,7 @@ static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,ppp_tx_cp (dev, pid,CP_CODE_REJ , ++ppp->seq, len, data);if (old_state !=OPENED && proto->state ==OPENED ) { -printk (KERN_INFO "%s: %s up\n" , dev->name,proto_name (pid)); +netdev_info (dev,"%s up\n" ,proto_name (pid));if (pid ==PID_LCP ) {netif_dormant_off (dev);ppp_cp_event (dev,PID_IPCP ,START ,0 ,0 ,0 ,NULL );
@@ -356,7 +355,7 @@ static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code, } }if (old_state ==OPENED && proto->state !=OPENED ) { -printk (KERN_INFO "%s: %s down\n" , dev->name,proto_name (pid)); +netdev_info (dev,"%s down\n" ,proto_name (pid));if (pid ==PID_LCP ) {netif_dormant_on (dev);ppp_cp_event (dev,PID_IPCP ,STOP ,0 ,0 ,0 ,NULL );
@@ -585,7 +584,7 @@ static void ppp_timer(unsigned long arg)break ;if (time_after (jiffies, ppp->last_pong + ppp->keepalive_timeout *HZ )) { -printk (KERN_INFO "%s: Link down\n" , proto->dev->name); +netdev_info (proto->dev,"Link down\n" );ppp_cp_event (proto->dev,PID_LCP ,STOP ,0 ,0 ,0 ,NULL );ppp_cp_event (proto->dev,PID_LCP ,START ,0 ,0 ,0 ,NULL ); }else {/* send keep-alive packet */
drivers/net/wan/hdlc_x25.c +5 -7
@@ -34,7 +34,7 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code)unsigned char *ptr;if ((skb =dev_alloc_skb (1 )) ==NULL ) { -printk (KERN_ERR "%s: out of memory\n" , dev->name); +netdev_err (dev,"out of memory\n" );return ; }
@@ -106,9 +106,8 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)/* Send connect confirm. msg to level 3 */ x25_connected (dev,0 ); else - printk(KERN_ERR "%s: LAPB connect request " -"failed, error code = %i\n" , - dev->name, result); + netdev_err(dev, "LAPB connect request failed, error code = %i\n", + result); }break ;
@@ -118,9 +117,8 @@ static netdev_tx_t x25_xmit(struct sk_buff *skb, struct net_device *dev)/* Send disconnect confirm. msg to level 3 */ x25_disconnected (dev,0 ); else - printk(KERN_ERR "%s: LAPB disconnect request " -"failed, error code = %i\n" , - dev->name, result); + netdev_err(dev, "LAPB disconnect request failed, error code = %i\n", + result); }break ;
drivers/net/wan/n2.c +21 -21
138 lines not on this page · raw message
drivers/net/wan/pc300too.c +17 -19
@@ -17,6 +17,8 @@* PC300/X21 cards. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h>
@@ -318,7 +320,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, card =kzalloc (sizeof (card_t),GFP_KERNEL );if (card ==NULL ) { -printk (KERN_ERR "pc300: unable to allocate memory\n" ); +pr_err ("unable to allocate memory\n" );pci_release_regions (pdev);pci_disable_device (pdev);return -ENOBUFS ;
@@ -328,7 +330,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,if (pci_resource_len (pdev,0 ) !=PC300_PLX_SIZE ||pci_resource_len (pdev,2 ) !=PC300_SCA_SIZE ||pci_resource_len (pdev,3 ) <16384 ) { -printk (KERN_ERR "pc300: invalid card EEPROM parameters\n" ); +pr_err ("invalid card EEPROM parameters\n" );pc300_pci_remove_one (pdev);return -EFAULT ; }
@@ -345,7 +347,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,if (card->plxbase ==NULL || card->scabase ==NULL || card->rambase ==NULL ) { -printk (KERN_ERR "pc300: ioremap() failed\n" ); +pr_err ("ioremap() failed\n" );pc300_pci_remove_one (pdev); }
@@ -370,7 +372,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,for (i =0 ; i < card->n_ports; i++)if (!(card->ports[i].netdev =alloc_hdlcdev (&card->ports[i]))) { -printk (KERN_ERR "pc300: unable to allocate memory\n" ); +pr_err ("unable to allocate memory\n" );pc300_pci_remove_one (pdev);return -ENOMEM ; }
@@ -411,15 +413,14 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, card->buff_offset = card->n_ports *sizeof (pkt_desc) * (card->tx_ring_buffers + card->rx_ring_buffers); -printk (KERN_INFO "pc300: PC300/%s, %u KB RAM at 0x%x, IRQ%u, " -"using %u TX + %u RX packets rings\n" , - card->type ==PC300_X21 ?"X21" : - card->type ==PC300_TE ?"TE" :"RSV" , - ramsize /1024 , ramphys, pdev->irq, - card->tx_ring_buffers, card->rx_ring_buffers); +pr_info ("PC300/%s, %u KB RAM at 0x%x, IRQ%u, using %u TX + %u RX packets rings\n" , + card->type ==PC300_X21 ?"X21" : + card->type ==PC300_TE ?"TE" :"RSV" , + ramsize /1024 , ramphys, pdev->irq, + card->tx_ring_buffers, card->rx_ring_buffers);if (card->tx_ring_buffers <1 ) { -printk (KERN_ERR "pc300: RAM test failed\n" ); +pr_err ("RAM test failed\n" );pc300_pci_remove_one (pdev);return -EFAULT ; }
@@ -429,8 +430,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,/* Allocate IRQ */ if (request_irq (pdev->irq, sca_intr,IRQF_SHARED ,"pc300" , card)) { -printk (KERN_WARNING "pc300: could not allocate IRQ%d.\n" , - pdev->irq); +pr_warn ("could not allocate IRQ%d\n" , pdev->irq);pc300_pci_remove_one (pdev);return -EBUSY ; }
@@ -466,15 +466,13 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,sca_init_port (port);if (register_hdlc_device (dev)) { -printk (KERN_ERR "pc300: unable to register hdlc " -"device\n" ); +pr_err ("unable to register hdlc device\n" ); port->card =NULL ;pc300_pci_remove_one (pdev);return -ENOBUFS ; } -printk (KERN_INFO "%s: PC300 channel %d\n" , - dev->name, port->chan); +netdev_info (dev,"PC300 channel %d\n" , port->chan); }return 0 ; }
@@ -505,11 +503,11 @@ static struct pci_driver pc300_pci_driver = {static int __init pc300_init_module (void ) {if (pci_clock_freq <1000000 || pci_clock_freq >80000000 ) { -printk (KERN_ERR "pc300: Invalid PCI clock frequency\n" ); +pr_err ("Invalid PCI clock frequency\n" );return -EINVAL ; }if (use_crystal_clock !=0 && use_crystal_clock !=1 ) { -printk (KERN_ERR "pc300: Invalid 'use_crystal_clock' value\n" ); +pr_err ("Invalid 'use_crystal_clock' value\n" );return -EINVAL ; }
drivers/net/wan/pci200syn.c +14 -15
@@ -14,6 +14,8 @@* PLX Technology Inc. PCI9052 Data Book */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/capability.h>
@@ -297,7 +299,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, card =kzalloc (sizeof (card_t),GFP_KERNEL );if (card ==NULL ) { -printk (KERN_ERR "pci200syn: unable to allocate memory\n" ); +pr_err ("unable to allocate memory\n" );pci_release_regions (pdev);pci_disable_device (pdev);return -ENOBUFS ;
@@ -306,7 +308,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, card->ports[0 ].netdev =alloc_hdlcdev (&card->ports[0 ]); card->ports[1 ].netdev =alloc_hdlcdev (&card->ports[1 ]);if (!card->ports[0 ].netdev || !card->ports[1 ].netdev) { -printk (KERN_ERR "pci200syn: unable to allocate memory\n" ); +pr_err ("unable to allocate memory\n" );pci200_pci_remove_one (pdev);return -ENOMEM ; }
@@ -314,7 +316,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,if (pci_resource_len (pdev,0 ) !=PCI200SYN_PLX_SIZE ||pci_resource_len (pdev,2 ) !=PCI200SYN_SCA_SIZE ||pci_resource_len (pdev,3 ) <16384 ) { -printk (KERN_ERR "pci200syn: invalid card EEPROM parameters\n" ); +pr_err ("invalid card EEPROM parameters\n" );pci200_pci_remove_one (pdev);return -EFAULT ; }
@@ -331,7 +333,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,if (card->plxbase ==NULL || card->scabase ==NULL || card->rambase ==NULL ) { -printk (KERN_ERR "pci200syn: ioremap() failed\n" ); +pr_err ("ioremap() failed\n" );pci200_pci_remove_one (pdev);return -EFAULT ; }
@@ -357,12 +359,12 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, card->buff_offset =2 *sizeof (pkt_desc) * (card->tx_ring_buffers + card->rx_ring_buffers); -printk (KERN_INFO "pci200syn: %u KB RAM at 0x%x, IRQ%u, using %u TX +" -" %u RX packets rings\n" , ramsize /1024 , ramphys, - pdev->irq, card->tx_ring_buffers, card->rx_ring_buffers); +pr_info ("%u KB RAM at 0x%x, IRQ%u, using %u TX + %u RX packets rings\n" , + ramsize /1024 , ramphys, + pdev->irq, card->tx_ring_buffers, card->rx_ring_buffers);if (card->tx_ring_buffers <1 ) { -printk (KERN_ERR "pci200syn: RAM test failed\n" ); +pr_err ("RAM test failed\n" );pci200_pci_remove_one (pdev);return -EFAULT ; }
@@ -373,8 +375,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,/* Allocate IRQ */ if (request_irq (pdev->irq, sca_intr,IRQF_SHARED ,"pci200syn" , card)) { -printk (KERN_WARNING "pci200syn: could not allocate IRQ%d.\n" , - pdev->irq); +pr_warn ("could not allocate IRQ%d\n" , pdev->irq);pci200_pci_remove_one (pdev);return -EBUSY ; }
@@ -400,15 +401,13 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, port->card = card;sca_init_port (port);if (register_hdlc_device (dev)) { -printk (KERN_ERR "pci200syn: unable to register hdlc " -"device\n" ); +pr_err ("unable to register hdlc device\n" ); port->card =NULL ;pci200_pci_remove_one (pdev);return -ENOBUFS ; } -printk (KERN_INFO "%s: PCI200SYN channel %d\n" , - dev->name, port->chan); +netdev_info (dev,"PCI200SYN channel %d\n" , port->chan); }sca_flush (card);
@@ -435,7 +434,7 @@ static struct pci_driver pci200_pci_driver = {static int __init pci200_init_module (void ) {if (pci_clock_freq <1000000 || pci_clock_freq >80000000 ) { -printk (KERN_ERR "pci200syn: Invalid PCI clock frequency\n" ); +pr_err ("Invalid PCI clock frequency\n" );return -EINVAL ; }return pci_register_driver (&pci200_pci_driver);
drivers/net/wan/wanxl.c +42 -48
237 lines not on this page · raw message
Signature · 1 line
1.7.6.rc1
Krzysztof Halasa
maintainerRe: [PATCH 1/8] generic_hdlc: Update to current logging forms
Quoted 16 lines · Joe Perches
Use
pr_fmt, pr_<level> and netdev_<level> as appropriate.Signed-off-by Joe Perches <[email protected]>--- drivers/net/wan/c101.c | 30 +++++++------- drivers/net/wan/hd64570.c | 8 ++-- drivers/net/wan/hd64572.c | 8 ++-- drivers/net/wan/hdlc.c | 16 ++++--- drivers/net/wan/hdlc_cisco.c | 21 ++++------ drivers/net/wan/hdlc_fr.c | 96 +++++++++++++++++++----------------------- drivers/net/wan/hdlc_ppp.c | 9 ++-- drivers/net/wan/hdlc_x25.c | 12 ++--- drivers/net/wan/n2.c | 42 +++++++++--------- drivers/net/wan/pc300too.c | 36 +++++++-------- drivers/net/wan/pci200syn.c | 29 ++++++------- drivers/net/wan/wanxl.c | 90 ++++++++++++++++++---------------------
Looks good. I'll do some tests and then pass upstream. Thanks.
Signature · 1 line
Krzysztof Halasa
Krzysztof Halasa
maintainerRe: [PATCH 1/8] generic_hdlc: Update to current logging forms
In reply to Joe PerchesQuoted 1 line · Joe Perches
Use
pr_fmt, pr_<level> and netdev_<level> as appropriate.
Good to see both are already in David's tree.
Signature · 1 line
Krzysztof Halasa
PATCH 2/8 cosa: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/cosa.c | 226 ++++++++++++++++++++++------------------------- 1 files changed, 106 insertions(+), 120 deletions(-)
drivers/net/wan/cosa.c +106 -120
@@ -74,6 +74,8 @@* The Sync PPP/Cisco HDLC layer (syncppp.c) ported to Linux by Alan Cox */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/sched.h>
@@ -361,14 +363,13 @@ static int __init cosa_init(void)if (cosa_major >0 ) {if (register_chrdev (cosa_major,"cosa" , &cosa_fops)) { -printk (KERN_WARNING "cosa: unable to get major %d\n" , - cosa_major); +pr_warn ("unable to get major %d\n" , cosa_major); err = -EIO ; goto out; } }else {if (!(cosa_major=register_chrdev (0 ,"cosa" , &cosa_fops))) { -printk (KERN_WARNING "cosa: unable to register chardev\n" ); +pr_warn ("unable to register chardev\n" ); err = -EIO ; goto out; }
@@ -378,7 +379,7 @@ static int __init cosa_init(void)for (i=0 ; io[i] !=0 && i <MAX_CARDS ; i++)cosa_probe (io[i], irq[i], dma[i]);if (!nr_cards) { -printk (KERN_WARNING "cosa: no devices found.\n" ); +pr_warn ("no devices found\n" );unregister_chrdev (cosa_major,"cosa" ); err = -ENODEV ; goto out;
@@ -447,26 +448,25 @@ static int cosa_probe(int base, int irq, int dma)/* Checking validity of parameters: */ /* IRQ should be 2-7 or 10-15; negative IRQ means autoprobe */ if ((irq >=0 && irq <2 ) || irq >15 || (irq <10 && irq >7 )) { -printk (KERN_INFO "cosa_probe: invalid IRQ %d\n" , irq); +pr_info ("invalid IRQ %d\n" , irq);return -1 ; }/* I/O address should be between 0x100 and 0x3ff and should be * multiple of 8. */ if (base <0x100 || base >0x3ff || base &0x7 ) { -printk (KERN_INFO "cosa_probe: invalid I/O address 0x%x\n" , - base); +pr_info ("invalid I/O address 0x%x\n" , base);return -1 ; }/* DMA should be 0,1 or 3-7 */ if (dma <0 || dma ==4 || dma >7 ) { -printk (KERN_INFO "cosa_probe: invalid DMA %d\n" , dma); +pr_info ("invalid DMA %d\n" , dma);return -1 ; }/* and finally, on 16-bit COSA DMA should be 4-7 and * I/O base should not be multiple of 0x10 */ if (((base &0x8 ) && dma <4 ) || (!(base &0x8 ) && dma >3 )) { -printk (KERN_INFO "cosa_probe: 8/16 bit base and DMA mismatch" -" (base=0x%x, dma=%d)\n" , base, dma); +pr_info ("8/16 bit base and DMA mismatch (base=0x%x, dma=%d)\n" , + base, dma);return -1 ; }
@@ -479,7 +479,7 @@ static int cosa_probe(int base, int irq, int dma)return -1 ;if (cosa_reset_and_read_id (cosa, cosa->id_string) <0 ) { -printk (KERN_DEBUG "cosa: probe at 0x%x failed.\n" , base); +printk (KERN_DEBUG "probe at 0x%x failed.\n" , base); err =-1 ; goto err_out; }
@@ -492,8 +492,7 @@ static int cosa_probe(int base, int irq, int dma)else {/* Print a warning only if we are not autoprobing */ #ifndef COSA_ISA_AUTOPROBE -printk (KERN_INFO "cosa: valid signature not found at 0x%x.\n" , - base); +pr_info ("valid signature not found at 0x%x\n" , base);#endif err =-1 ; goto err_out;
@@ -501,14 +500,14 @@ static int cosa_probe(int base, int irq, int dma)/* Update the name of the region now we know the type of card */ release_region (base,is_8bit (cosa)?2 :4 );if (!request_region (base,is_8bit (cosa)?2 :4 , cosa->type)) { -printk (KERN_DEBUG "cosa: changing name at 0x%x failed.\n" , base); +printk (KERN_DEBUG "changing name at 0x%x failed.\n" , base);return -1 ; }/* Now do IRQ autoprobe */ if (irq <0 ) {unsigned long irqs; -/* printk(KERN_INFO "IRQ autoprobe\n"); */ +/* pr_info("IRQ autoprobe\n"); */ irqs =probe_irq_on ();/* * Enable interrupt on tx buffer empty (it sure is)
@@ -526,13 +525,13 @@ static int cosa_probe(int base, int irq, int dma)cosa_getdata8 (cosa);if (irq <0 ) { -printk (KERN_INFO "cosa IRQ autoprobe: multiple interrupts obtained (%d, board at 0x%x)\n" , +pr_info ("multiple interrupts obtained (%d, board at 0x%x)\n" , irq, cosa->datareg); err =-1 ; goto err_out; }if (irq ==0 ) { -printk (KERN_INFO "cosa IRQ autoprobe: no interrupt obtained (board at 0x%x)\n" , +pr_info ("no interrupt obtained (board at 0x%x)\n" , cosa->datareg);/* return -1; */ }
@@ -579,8 +578,7 @@ static int cosa_probe(int base, int irq, int dma)/* Register the network interface */ if (!(chan->netdev =alloc_hdlcdev (chan))) { -printk (KERN_WARNING "%s: alloc_hdlcdev failed.\n" , - chan->name); +pr_warn ("%s: alloc_hdlcdev failed\n" , chan->name); goto err_hdlcdev; }dev_to_hdlc (chan->netdev)->attach = cosa_net_attach;
@@ -591,14 +589,14 @@ static int cosa_probe(int base, int irq, int dma) chan->netdev->irq = chan->cosa->irq; chan->netdev->dma = chan->cosa->dma;if (register_hdlc_device (chan->netdev)) { -printk (KERN_WARNING "%s: register_hdlc_device()" -" failed.\n" , chan->netdev->name); +netdev_warn (chan->netdev, +"register_hdlc_device() failed\n" );free_netdev (chan->netdev); goto err_hdlcdev; } } -printk (KERN_INFO "cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n" , +pr_info ("cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n" , cosa->num, cosa->id_string, cosa->type, cosa->datareg, cosa->irq, cosa->dma, cosa->nchannels);
@@ -618,8 +616,7 @@ err_out1:free_irq (cosa->irq, cosa); err_out:release_region (cosa->datareg,is_8bit (cosa)?2 :4 ); -printk (KERN_NOTICE "cosa%d: allocating resources failed\n" , - cosa->num); +pr_notice ("cosa%d: allocating resources failed\n" , cosa->num);return err; }
@@ -641,14 +638,14 @@ static int cosa_net_open(struct net_device *dev)unsigned long flags;if (!(chan->cosa->firmware_status &COSA_FW_START )) { -printk (KERN_NOTICE "%s: start the firmware first (status %d)\n" , - chan->cosa->name, chan->cosa->firmware_status); +pr_notice ("%s: start the firmware first (status %d)\n" , + chan->cosa->name, chan->cosa->firmware_status);return -EPERM ; }spin_lock_irqsave (&chan->cosa->lock, flags);if (chan->usage !=0 ) { -printk (KERN_WARNING "%s: cosa_net_open called with usage count" -" %d\n" , chan->name, chan->usage); +pr_warn ("%s: cosa_net_open called with usage count %d\n" , + chan->name, chan->usage);spin_unlock_irqrestore (&chan->cosa->lock, flags);return -EBUSY ; }
@@ -736,8 +733,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)kfree_skb (chan->rx_skb); chan->rx_skb =dev_alloc_skb (size);if (chan->rx_skb ==NULL ) { -printk (KERN_NOTICE "%s: Memory squeeze, dropping packet\n" , - chan->name); +pr_notice ("%s: Memory squeeze, dropping packet\n" , chan->name); chan->netdev->stats.rx_dropped++;return NULL ; }
@@ -748,8 +744,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)static int cosa_net_rx_done (struct channel_data *chan) {if (!chan->rx_skb) { -printk (KERN_WARNING "%s: rx_done with empty skb!\n" , - chan->name); +pr_warn ("%s: rx_done with empty skb!\n" , chan->name); chan->netdev->stats.rx_errors++; chan->netdev->stats.rx_frame_errors++;return 0 ;
@@ -768,8 +763,7 @@ static int cosa_net_rx_done(struct channel_data *chan)static int cosa_net_tx_done (struct channel_data *chan,int size) {if (!chan->tx_skb) { -printk (KERN_WARNING "%s: tx_done with empty skb!\n" , - chan->name); +pr_warn ("%s: tx_done with empty skb!\n" , chan->name); chan->netdev->stats.tx_errors++; chan->netdev->stats.tx_aborted_errors++;return 1 ;
@@ -794,15 +788,15 @@ static ssize_t cosa_read(struct file *file,char *kbuf;if (!(cosa->firmware_status &COSA_FW_START )) { -printk (KERN_NOTICE "%s: start the firmware first (status %d)\n" , - cosa->name, cosa->firmware_status); +pr_notice ("%s: start the firmware first (status %d)\n" , + cosa->name, cosa->firmware_status);return -EPERM ; }if (mutex_lock_interruptible (&chan->rlock))return -ERESTARTSYS ;if ((chan->rxdata =kmalloc (COSA_MTU ,GFP_DMA |GFP_KERNEL )) ==NULL ) { -printk (KERN_INFO "%s: cosa_read() - OOM\n" , cosa->name); +pr_info ("%s: cosa_read() - OOM\n" , cosa->name);mutex_unlock (&chan->rlock);return -ENOMEM ; }
@@ -869,8 +863,8 @@ static ssize_t cosa_write(struct file *file,char *kbuf;if (!(cosa->firmware_status &COSA_FW_START )) { -printk (KERN_NOTICE "%s: start the firmware first (status %d)\n" , - cosa->name, cosa->firmware_status); +pr_notice ("%s: start the firmware first (status %d)\n" , + cosa->name, cosa->firmware_status);return -EPERM ; }if (down_interruptible (&chan->wsem))
@@ -881,8 +875,8 @@ static ssize_t cosa_write(struct file *file,/* Allocate the buffer */ if ((kbuf =kmalloc (count,GFP_KERNEL |GFP_DMA )) ==NULL ) { -printk (KERN_NOTICE "%s: cosa_write() OOM - dropping packet\n" , - cosa->name); +pr_notice ("%s: cosa_write() OOM - dropping packet\n" , + cosa->name);up (&chan->wsem);return -ENOMEM ; }
@@ -932,7 +926,7 @@ static int chrdev_tx_done(struct channel_data *chan, int size)static unsigned int cosa_poll (struct file *file,poll_table *poll) { -printk (KERN_INFO "cosa_poll is here\n" ); +pr_info ("cosa_poll is here\n" );return 0 ; }
@@ -1017,15 +1011,14 @@ static inline int cosa_reset(struct cosa_data *cosa) {char idstring[COSA_MAX_ID_STRING ];if (cosa->usage >1 ) -printk (KERN_INFO "cosa%d: WARNING: reset requested with cosa->usage > 1 (%d). Odd things may happen.\n" , +pr_info ("cosa%d: WARNING: reset requested with cosa->usage > 1 (%d). Odd things may happen.\n" , cosa->num, cosa->usage); cosa->firmware_status &= ~(COSA_FW_RESET |COSA_FW_START );if (cosa_reset_and_read_id (cosa, idstring) <0 ) { -printk (KERN_NOTICE "cosa%d: reset failed\n" , cosa->num); +pr_notice ("cosa%d: reset failed\n" , cosa->num);return -EIO ; } -printk (KERN_INFO "cosa%d: resetting device: %s\n" , cosa->num, - idstring); +pr_info ("cosa%d: resetting device: %s\n" , cosa->num, idstring); cosa->firmware_status |=COSA_FW_RESET ;return 0 ; }
@@ -1037,11 +1030,11 @@ static inline int cosa_download(struct cosa_data *cosa, void __user *arg)int i;if (cosa->usage >1 ) -printk (KERN_INFO "%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n" , +pr_info ("%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n" , cosa->name, cosa->usage);if (!(cosa->firmware_status &COSA_FW_RESET )) { -printk (KERN_NOTICE "%s: reset the card first (status %d).\n" , - cosa->name, cosa->firmware_status); +pr_notice ("%s: reset the card first (status %d)\n" , + cosa->name, cosa->firmware_status);return -EPERM ; }
@@ -1059,11 +1052,11 @@ static inline int cosa_download(struct cosa_data *cosa, void __user *arg) i =download (cosa, d.code, d.len, d.addr);if (i <0 ) { -printk (KERN_NOTICE "cosa%d: microcode download failed: %d\n" , - cosa->num, i); +pr_notice ("cosa%d: microcode download failed: %d\n" , + cosa->num, i);return -EIO ; } -printk (KERN_INFO "cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n" , +pr_info ("cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n" , cosa->num, d.len, d.addr); cosa->firmware_status |=COSA_FW_RESET |COSA_FW_DOWNLOAD ;return 0 ;
@@ -1076,12 +1069,11 @@ static inline int cosa_readmem(struct cosa_data *cosa, void __user *arg)int i;if (cosa->usage >1 ) -printk (KERN_INFO "cosa%d: WARNING: readmem requested with " -"cosa->usage > 1 (%d). Odd things may happen.\n" , +pr_info ("cosa%d: WARNING: readmem requested with cosa->usage > 1 (%d). Odd things may happen.\n" , cosa->num, cosa->usage);if (!(cosa->firmware_status &COSA_FW_RESET )) { -printk (KERN_NOTICE "%s: reset the card first (status %d).\n" , - cosa->name, cosa->firmware_status); +pr_notice ("%s: reset the card first (status %d)\n" , + cosa->name, cosa->firmware_status);return -EPERM ; }
@@ -1093,11 +1085,10 @@ static inline int cosa_readmem(struct cosa_data *cosa, void __user *arg) i =readmem (cosa, d.code, d.len, d.addr);if (i <0 ) { -printk (KERN_NOTICE "cosa%d: reading memory failed: %d\n" , - cosa->num, i); +pr_notice ("cosa%d: reading memory failed: %d\n" , cosa->num, i);return -EIO ; } -printk (KERN_INFO "cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n" , +pr_info ("cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n" , cosa->num, d.len, d.addr); cosa->firmware_status |=COSA_FW_RESET ;return 0 ;
@@ -1109,23 +1100,22 @@ static inline int cosa_start(struct cosa_data *cosa, int address)int i;if (cosa->usage >1 ) -printk (KERN_INFO "cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n" , +pr_info ("cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n" , cosa->num, cosa->usage);if ((cosa->firmware_status & (COSA_FW_RESET |COSA_FW_DOWNLOAD )) != (COSA_FW_RESET |COSA_FW_DOWNLOAD )) { -printk (KERN_NOTICE "%s: download the microcode and/or reset the card first (status %d).\n" , - cosa->name, cosa->firmware_status); +pr_notice ("%s: download the microcode and/or reset the card first (status %d)\n" , + cosa->name, cosa->firmware_status);return -EPERM ; } cosa->firmware_status &= ~COSA_FW_RESET ;if ((i=startmicrocode (cosa, address)) <0 ) { -printk (KERN_NOTICE "cosa%d: start microcode at 0x%04x failed: %d\n" , - cosa->num, address, i); +pr_notice ("cosa%d: start microcode at 0x%04x failed: %d\n" , + cosa->num, address, i);return -EIO ; } -printk (KERN_INFO "cosa%d: starting microcode at 0x%04x\n" , - cosa->num, address); +pr_info ("cosa%d: starting microcode at 0x%04x\n" , cosa->num, address); cosa->startaddr = address; cosa->firmware_status |=COSA_FW_START ;return 0 ;
@@ -1255,11 +1245,11 @@ static int cosa_start_tx(struct channel_data *chan, char *buf, int len)#ifdef DEBUG_DATA int i; -printk (KERN_INFO "cosa%dc%d: starting tx(0x%x)" , chan->cosa->num, - chan->num, len); +pr_info ("cosa%dc%d: starting tx(0x%x)" , + chan->cosa->num, chan->num, len);for (i=0 ; i<len; i++) -printk (" %02x" , buf[i]&0xff ); -printk ("\n" ); +pr_cont (" %02x" , buf[i]&0xff ); +pr_cont ("\n" );#endif spin_lock_irqsave (&cosa->lock, flags); chan->txbuf = buf;
@@ -1353,7 +1343,7 @@ static void cosa_kick(struct cosa_data *cosa)if (test_bit (TXBIT , &cosa->rxtx)) s ="TX DMA" ; -printk (KERN_INFO "%s: %s timeout - restarting.\n" , cosa->name, s); +pr_info ("%s: %s timeout - restarting\n" , cosa->name, s);spin_lock_irqsave (&cosa->lock, flags); cosa->rxtx =0 ;
@@ -1387,7 +1377,7 @@ static int cosa_dma_able(struct channel_data *chan, char *buf, int len)return 0 ;if ((b^ (b+len)) &0x10000 ) {if (count++ <5 ) -printk (KERN_INFO "%s: packet spanning a 64k boundary\n" , +pr_info ("%s: packet spanning a 64k boundary\n" , chan->name);return 0 ; }
@@ -1498,8 +1488,7 @@ static int readmem(struct cosa_data *cosa, char __user *microcode, int length, ichar c;int i;if ((i=get_wait_data (cosa)) ==-1 ) { -printk (KERN_INFO "cosa: 0x%04x bytes remaining\n" , - length); +pr_info ("0x%04x bytes remaining\n" , length);return -11 ; } c=i;
@@ -1582,14 +1571,15 @@ static int get_wait_data(struct cosa_data *cosa)short r; r =cosa_getdata8 (cosa);#if 0 -printk (KERN_INFO "cosa: get_wait_data returning after %d retries\n" ,999 -retries); +pr_info ("get_wait_data returning after %d retries\n" , +999 -retries);#endif return r; }/* sleep if not ready to read */ schedule_timeout_interruptible (1 ); } -printk (KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n" , +pr_info ("timeout in get_wait_data (status 0x%x)\n" ,cosa_getstatus (cosa));return -1 ; }
@@ -1607,7 +1597,7 @@ static int put_wait_data(struct cosa_data *cosa, int data)if (cosa_getstatus (cosa) &SR_TX_RDY ) {cosa_putdata8 (cosa, data);#if 0 -printk (KERN_INFO "Putdata: %d retries\n" ,999 -retries); +pr_info ("Putdata: %d retries\n" ,999 -retries);#endif return 0 ; }
@@ -1616,7 +1606,7 @@ static int put_wait_data(struct cosa_data *cosa, int data)schedule_timeout_interruptible (1 );#endif } -printk (KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n" , +pr_info ("cosa%d: timeout in put_wait_data (status 0x%x)\n" , cosa->num,cosa_getstatus (cosa));return -1 ; }
@@ -1636,13 +1626,13 @@ static int puthexnumber(struct cosa_data *cosa, int number)sprintf (temp,"%04X" , number);for (i=0 ; i<4 ; i++) {if (put_wait_data (cosa, temp[i]) ==-1 ) { -printk (KERN_NOTICE "cosa%d: puthexnumber failed to write byte %d\n" , - cosa->num, i); +pr_notice ("cosa%d: puthexnumber failed to write byte %d\n" , + cosa->num, i);return -1 -2 *i; }if (get_wait_data (cosa) != temp[i]) { -printk (KERN_NOTICE "cosa%d: puthexhumber failed to read echo of byte %d\n" , - cosa->num, i); +pr_notice ("cosa%d: puthexhumber failed to read echo of byte %d\n" , + cosa->num, i);return -2 -2 *i; } }
@@ -1687,8 +1677,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status) {unsigned long flags, flags1;#ifdef DEBUG_IRQS -printk (KERN_INFO "cosa%d: SR_DOWN_REQUEST status=0x%04x\n" , - cosa->num, status); +pr_info ("cosa%d: SR_DOWN_REQUEST status=0x%04x\n" , cosa->num, status);#endif spin_lock_irqsave (&cosa->lock, flags);set_bit (TXBIT , &cosa->rxtx);
@@ -1696,8 +1685,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)/* flow control, see the comment above */ int i=0 ;if (!cosa->txbitmap) { -printk (KERN_WARNING "%s: No channel wants data " -"in TX IRQ. Expect DMA timeout." , +pr_warn ("%s: No channel wants data in TX IRQ. Expect DMA timeout.\n" , cosa->name);put_driver_status_nolock (cosa);clear_bit (TXBIT , &cosa->rxtx);
@@ -1780,14 +1768,14 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)if (cosa->busmaster) {unsigned long addr =virt_to_bus (cosa->txbuf);int count=0 ; -printk (KERN_INFO "busmaster IRQ\n" ); +pr_info ("busmaster IRQ\n" );while (!(cosa_getstatus (cosa)&SR_TX_RDY )) { count++;udelay (10 );if (count >1000 )break ; } -printk (KERN_INFO "status %x\n" ,cosa_getstatus (cosa)); -printk (KERN_INFO "ready after %d loops\n" , count); +pr_info ("status %x\n" ,cosa_getstatus (cosa)); +pr_info ("ready after %d loops\n" , count);cosa_putdata16 (cosa, (addr >>16 )&0xffff ); count =0 ;
@@ -1796,7 +1784,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)if (count >1000 )break ;udelay (10 ); } -printk (KERN_INFO "ready after %d loops\n" , count); +pr_info ("ready after %d loops\n" , count);cosa_putdata16 (cosa, addr &0xffff ); flags1 =claim_dma_lock ();set_dma_mode (cosa->dma,DMA_MODE_CASCADE );
@@ -1824,7 +1812,7 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status) {unsigned long flags;#ifdef DEBUG_IRQS -printk (KERN_INFO "cosa%d: SR_UP_REQUEST\n" , cosa->num); +pr_info ("cosa%d: SR_UP_REQUEST\n" , cosa->num);#endif spin_lock_irqsave (&cosa->lock, flags);
@@ -1847,7 +1835,7 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status)debug_data_in (cosa, cosa->rxsize &0xff );#endif #if 0 -printk (KERN_INFO "cosa%d: receive rxsize = (0x%04x).\n" , +pr_info ("cosa%d: receive rxsize = (0x%04x)\n" , cosa->num, cosa->rxsize);#endif }
@@ -1857,12 +1845,12 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status)debug_data_in (cosa, cosa->rxsize);#endif #if 0 -printk (KERN_INFO "cosa%d: receive rxsize = (0x%04x).\n" , +pr_info ("cosa%d: receive rxsize = (0x%04x)\n" , cosa->num, cosa->rxsize);#endif }if (((cosa->rxsize &0xe000 ) >>13 ) >= cosa->nchannels) { -printk (KERN_WARNING "%s: rx for unknown channel (0x%04x)\n" , +pr_warn ("%s: rx for unknown channel (0x%04x)\n" , cosa->name, cosa->rxsize);spin_unlock_irqrestore (&cosa->lock, flags); goto reject;
@@ -1877,7 +1865,7 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status)if (!cosa->rxbuf) { reject:/* Reject the packet */ -printk (KERN_INFO "cosa%d: rejecting packet on channel %d\n" , +pr_info ("cosa%d: rejecting packet on channel %d\n" , cosa->num, cosa->rxchan->num); cosa->rxbuf = cosa->bouncebuf; }
@@ -1924,11 +1912,11 @@ static inline void eot_interrupt(struct cosa_data *cosa, int status)#ifdef DEBUG_DATA {int i; -printk (KERN_INFO "cosa%dc%d: done rx(0x%x)" , cosa->num, - cosa->rxchan->num, cosa->rxsize); +pr_info ("cosa%dc%d: done rx(0x%x)" , + cosa->num, cosa->rxchan->num, cosa->rxsize);for (i=0 ; i<cosa->rxsize; i++) -printk (" %02x" , cosa->rxbuf[i]&0xff ); -printk ("\n" ); +pr_cont (" %02x" , cosa->rxbuf[i]&0xff ); +pr_cont ("\n" ); }#endif /* Packet for unknown channel? */
@@ -1940,8 +1928,7 @@ static inline void eot_interrupt(struct cosa_data *cosa, int status)if (cosa->rxchan->rx_done (cosa->rxchan))clear_bit (cosa->rxchan->num, &cosa->rxbitmap); }else { -printk (KERN_NOTICE "cosa%d: unexpected EOT interrupt\n" , - cosa->num); +pr_notice ("cosa%d: unexpected EOT interrupt\n" , cosa->num); }/* * Clear the RXBIT, TXBIT and IRQBIT (the latest should be
@@ -1963,8 +1950,7 @@ static irqreturn_t cosa_interrupt(int irq, void *cosa_) again: status =cosa_getstatus (cosa);#ifdef DEBUG_IRQS -printk (KERN_INFO "cosa%d: got IRQ, status 0x%02x\n" , cosa->num, - status &0xff ); +pr_info ("cosa%d: got IRQ, status 0x%02x\n" , cosa->num, status &0xff );#endif #ifdef DEBUG_IO debug_status_in (cosa, status);
@@ -1985,15 +1971,15 @@ again:udelay (100 ); goto again; } -printk (KERN_INFO "cosa%d: unknown status 0x%02x in IRQ after %d retries\n" , +pr_info ("cosa%d: unknown status 0x%02x in IRQ after %d retries\n" , cosa->num, status &0xff , count); }#ifdef DEBUG_IRQS if (count) -printk (KERN_INFO "%s: %d-times got unknown status in IRQ\n" , +pr_info ("%s: %d-times got unknown status in IRQ\n" , cosa->name, count);else -printk (KERN_INFO "%s: returning from IRQ\n" , cosa->name); +pr_info ("%s: returning from IRQ\n" , cosa->name);#endif return IRQ_HANDLED ; }
@@ -2024,41 +2010,41 @@ static void debug_status_in(struct cosa_data *cosa, int status) s ="NO_REQ" ;break ; } -printk (KERN_INFO "%s: IO: status -> 0x%02x (%s%s%s%s)\n" , +pr_info ("%s: IO: status -> 0x%02x (%s%s%s%s)\n" , cosa->name, status, - status &SR_USR_RQ ?"USR_RQ|" :"" , - status &SR_TX_RDY ?"TX_RDY|" :"" , - status &SR_RX_RDY ?"RX_RDY|" :"" , + status &SR_USR_RQ ?"USR_RQ|" :"" , + status &SR_TX_RDY ?"TX_RDY|" :"" , + status &SR_RX_RDY ?"RX_RDY|" :"" , s); }static void debug_status_out (struct cosa_data *cosa,int status) { -printk (KERN_INFO "%s: IO: status <- 0x%02x (%s%s%s%s%s%s)\n" , +pr_info ("%s: IO: status <- 0x%02x (%s%s%s%s%s%s)\n" , cosa->name, status, - status &SR_RX_DMA_ENA ?"RXDMA|" :"!rxdma|" , - status &SR_TX_DMA_ENA ?"TXDMA|" :"!txdma|" , - status &SR_RST ?"RESET|" :"" , - status &SR_USR_INT_ENA ?"USRINT|" :"!usrint|" , - status &SR_TX_INT_ENA ?"TXINT|" :"!txint|" , - status &SR_RX_INT_ENA ?"RXINT" :"!rxint" ); + status &SR_RX_DMA_ENA ?"RXDMA|" :"!rxdma|" , + status &SR_TX_DMA_ENA ?"TXDMA|" :"!txdma|" , + status &SR_RST ?"RESET|" :"" , + status &SR_USR_INT_ENA ?"USRINT|" :"!usrint|" , + status &SR_TX_INT_ENA ?"TXINT|" :"!txint|" , + status &SR_RX_INT_ENA ?"RXINT" :"!rxint" ); }static void debug_data_in (struct cosa_data *cosa,int data) { -printk (KERN_INFO "%s: IO: data -> 0x%04x\n" , cosa->name, data); +pr_info ("%s: IO: data -> 0x%04x\n" , cosa->name, data); }static void debug_data_out (struct cosa_data *cosa,int data) { -printk (KERN_INFO "%s: IO: data <- 0x%04x\n" , cosa->name, data); +pr_info ("%s: IO: data <- 0x%04x\n" , cosa->name, data); }static void debug_data_cmd (struct cosa_data *cosa,int data) { -printk (KERN_INFO "%s: IO: data <- 0x%04x (%s|%s)\n" , +pr_info ("%s: IO: data <- 0x%04x (%s|%s)\n" , cosa->name, data, data &SR_RDY_RCV ?"RX_RDY" :"!rx_rdy" , data &SR_RDY_SND ?"TX_RDY" :"!tx_rdy" );
Signature · 1 line
1.7.6.rc1
Re: [PATCH 2/8] cosa: Update to current logging forms
Hello,
Joe Perches wrote:
: Use pr_fmt, pr_<level> and netdev_<level> as appropriate. :
: Signed-off-by: Joe Perches <[email protected]>
I am not sure whether the formatting changes
in the conditional expressions (in debug_status_out|in) are worth it, but whatever.
Thanks!
-Yenya
: ---
: drivers/net/wan/cosa.c | 226 ++++++++++++++++++++++------------------------- : 1 files changed, 106 insertions(+), 120 deletions(-)
:
: diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
: index 6fb6f8e..6aed238 100644
: --- a/drivers/net/wan/cosa.c
: +++ b/drivers/net/wan/cosa.c
: @@ -74,6 +74,8 @@
: * The Sync PPP/Cisco HDLC layer (syncppp.c) ported to Linux by Alan Cox
: */
:
: +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
: +
: #include <linux/module.h> : #include <linux/kernel.h> : #include <linux/sched.h>
: @@ -361,14 +363,13 @@ static int __init cosa_init(void) :
: if (cosa_major > 0) {
: if (register_chrdev(cosa_major, "cosa", &cosa_fops)) {
: - printk(KERN_WARNING "cosa: unable to get major %d\n",
: - cosa_major);
: + pr_warn("unable to get major %d\n", cosa_major);
: err = -EIO;
: goto out;
: }
: } else {
: if (!(cosa_major=register_chrdev(0, "cosa", &cosa_fops))) {
: - printk(KERN_WARNING "cosa: unable to register chardev\n");
: + pr_warn("unable to register chardev\n");
: err = -EIO;
: goto out;
: }
: @@ -378,7 +379,7 @@ static int __init cosa_init(void)
: for (i=0; io[i] != 0 && i < MAX_CARDS; i++)
: cosa_probe(io[i], irq[i], dma[i]);
: if (!nr_cards) {
: - printk(KERN_WARNING "cosa: no devices found.\n");
: + pr_warn("no devices found\n");
: unregister_chrdev(cosa_major, "cosa");
: err = -ENODEV;
: goto out;
: @@ -447,26 +448,25 @@ static int cosa_probe(int base, int irq, int dma)
: /* Checking validity of parameters: */
: /* IRQ should be 2-7 or 10-15; negative IRQ means autoprobe */
: if ((irq >= 0 && irq < 2) || irq > 15 || (irq < 10 && irq > 7)) {
: - printk (KERN_INFO "cosa_probe: invalid IRQ %d\n", irq);
: + pr_info("invalid IRQ %d\n", irq);
: return -1;
: }
: /* I/O address should be between 0x100 and 0x3ff and should be
: * multiple of 8. */
: if (base < 0x100 || base > 0x3ff || base & 0x7) {
: - printk (KERN_INFO "cosa_probe: invalid I/O address 0x%x\n",
: - base);
: + pr_info("invalid I/O address 0x%x\n", base);
: return -1;
: }
: /* DMA should be 0,1 or 3-7 */
: if (dma < 0 || dma == 4 || dma > 7) {
: - printk (KERN_INFO "cosa_probe: invalid DMA %d\n", dma);
: + pr_info("invalid DMA %d\n", dma);
: return -1;
: }
: /* and finally, on 16-bit COSA DMA should be 4-7 and
: * I/O base should not be multiple of 0x10 */
: if (((base & 0x8) && dma < 4) || (!(base & 0x8) && dma > 3)) {: - printk (KERN_INFO "cosa_probe: 8/16 bit base and DMA mismatch"
: - " (base=0x%x, dma=%d)\n", base, dma);
: + pr_info("8/16 bit base and DMA mismatch (base=0x%x, dma=%d)\n",
: + base, dma);
: return -1;
: }
:
: @@ -479,7 +479,7 @@ static int cosa_probe(int base, int irq, int dma)
: return -1;
:
: if (cosa_reset_and_read_id(cosa, cosa->id_string) < 0) {
: - printk(KERN_DEBUG "cosa: probe at 0x%x failed.\n", base);
: + printk(KERN_DEBUG "probe at 0x%x failed.\n", base);
: err = -1;
: goto err_out;
: }
: @@ -492,8 +492,7 @@ static int cosa_probe(int base, int irq, int dma)
: else {
: /* Print a warning only if we are not autoprobing */
: #ifndef COSA_ISA_AUTOPROBE
: - printk(KERN_INFO "cosa: valid signature not found at 0x%x.\n",
: - base);
: + pr_info("valid signature not found at 0x%x\n", base);
: #endif
: err = -1;
: goto err_out;
: @@ -501,14 +500,14 @@ static int cosa_probe(int base, int irq, int dma)
: /* Update the name of the region now we know the type of card */
: release_region(base, is_8bit(cosa)?2:4);
: if (!request_region(base, is_8bit(cosa)?2:4, cosa->type)) {: - printk(KERN_DEBUG "cosa: changing name at 0x%x failed.\n", base);
: + printk(KERN_DEBUG "changing name at 0x%x failed.\n", base);
: return -1;
: }
:
: /* Now do IRQ autoprobe */
: if (irq < 0) {
: unsigned long irqs;
: -/* printk(KERN_INFO "IRQ autoprobe\n"); */
: +/* pr_info("IRQ autoprobe\n"); */
: irqs = probe_irq_on();
: /*
: * Enable interrupt on tx buffer empty (it sure is) : @@ -526,13 +525,13 @@ static int cosa_probe(int base, int irq, int dma)
: cosa_getdata8(cosa);
:
: if (irq < 0) {
: - printk (KERN_INFO "cosa IRQ autoprobe: multiple interrupts obtained (%d, board at 0x%x)\n",
: + pr_info("multiple interrupts obtained (%d, board at 0x%x)\n",
: irq, cosa->datareg);
: err = -1;
: goto err_out;
: }
: if (irq == 0) {
: - printk (KERN_INFO "cosa IRQ autoprobe: no interrupt obtained (board at 0x%x)\n",
: + pr_info("no interrupt obtained (board at 0x%x)\n",
: cosa->datareg);
: /* return -1; */
: }: @@ -579,8 +578,7 @@ static int cosa_probe(int base, int irq, int dma) :
: /* Register the network interface */
: if (!(chan->netdev = alloc_hdlcdev(chan))) {
: - printk(KERN_WARNING "%s: alloc_hdlcdev failed.\n",
: - chan->name);
: + pr_warn("%s: alloc_hdlcdev failed\n", chan->name);
: goto err_hdlcdev;
: }
: dev_to_hdlc(chan->netdev)->attach = cosa_net_attach;
: @@ -591,14 +589,14 @@ static int cosa_probe(int base, int irq, int dma)
: chan->netdev->irq = chan->cosa->irq;
: chan->netdev->dma = chan->cosa->dma;
: if (register_hdlc_device(chan->netdev)) {: - printk(KERN_WARNING "%s: register_hdlc_device()"
: - " failed.\n", chan->netdev->name);
: + netdev_warn(chan->netdev,
: + "register_hdlc_device() failed\n");
: free_netdev(chan->netdev); : goto err_hdlcdev; : } : }
:
: - printk (KERN_INFO "cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n",
: + pr_info("cosa%d: %s (%s at 0x%x irq %d dma %d), %d channels\n",
: cosa->num, cosa->id_string, cosa->type,
: cosa->datareg, cosa->irq, cosa->dma, cosa->nchannels);
:
: @@ -618,8 +616,7 @@ err_out1:
: free_irq(cosa->irq, cosa); : err_out: : release_region(cosa->datareg,is_8bit(cosa)?2:4);
: - printk(KERN_NOTICE "cosa%d: allocating resources failed\n",
: - cosa->num);
: + pr_notice("cosa%d: allocating resources failed\n", cosa->num);
: return err;
: }
:
: @@ -641,14 +638,14 @@ static int cosa_net_open(struct net_device *dev)
: unsigned long flags;
:
: if (!(chan->cosa->firmware_status & COSA_FW_START)) {
: - printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
: - chan->cosa->name, chan->cosa->firmware_status);
: + pr_notice("%s: start the firmware first (status %d)\n",
: + chan->cosa->name, chan->cosa->firmware_status);
: return -EPERM;
: }
: spin_lock_irqsave(&chan->cosa->lock, flags);
: if (chan->usage != 0) {: - printk(KERN_WARNING "%s: cosa_net_open called with usage count"
: - " %d\n", chan->name, chan->usage);
: + pr_warn("%s: cosa_net_open called with usage count %d\n",
: + chan->name, chan->usage);
: spin_unlock_irqrestore(&chan->cosa->lock, flags);
: return -EBUSY;
: }
: @@ -736,8 +733,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)
: kfree_skb(chan->rx_skb);
: chan->rx_skb = dev_alloc_skb(size);
: if (chan->rx_skb == NULL) {
: - printk(KERN_NOTICE "%s: Memory squeeze, dropping packet\n",
: - chan->name);
: + pr_notice("%s: Memory squeeze, dropping packet\n", chan->name);
: chan->netdev->stats.rx_dropped++;
: return NULL;
: }
: @@ -748,8 +744,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)
: static int cosa_net_rx_done(struct channel_data *chan)
: {
: if (!chan->rx_skb) {
: - printk(KERN_WARNING "%s: rx_done with empty skb!\n",
: - chan->name);
: + pr_warn("%s: rx_done with empty skb!\n", chan->name);
: chan->netdev->stats.rx_errors++;
: chan->netdev->stats.rx_frame_errors++;
: return 0;
: @@ -768,8 +763,7 @@ static int cosa_net_rx_done(struct channel_data *chan)
: static int cosa_net_tx_done(struct channel_data *chan, int size)
: {
: if (!chan->tx_skb) {
: - printk(KERN_WARNING "%s: tx_done with empty skb!\n",
: - chan->name);
: + pr_warn("%s: tx_done with empty skb!\n", chan->name);
: chan->netdev->stats.tx_errors++;
: chan->netdev->stats.tx_aborted_errors++;
: return 1;: @@ -794,15 +788,15 @@ static ssize_t cosa_read(struct file *file,
: char *kbuf;
:
: if (!(cosa->firmware_status & COSA_FW_START)) {
: - printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
: - cosa->name, cosa->firmware_status);
: + pr_notice("%s: start the firmware first (status %d)\n",
: + cosa->name, cosa->firmware_status);
: return -EPERM;
: }
: if (mutex_lock_interruptible(&chan->rlock))
: return -ERESTARTSYS;
:
: if ((chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL)) == NULL) {
: - printk(KERN_INFO "%s: cosa_read() - OOM\n", cosa->name);
: + pr_info("%s: cosa_read() - OOM\n", cosa->name);
: mutex_unlock(&chan->rlock);
: return -ENOMEM;
: }: @@ -869,8 +863,8 @@ static ssize_t cosa_write(struct file *file,
: char *kbuf;
:
: if (!(cosa->firmware_status & COSA_FW_START)) {
: - printk(KERN_NOTICE "%s: start the firmware first (status %d)\n",
: - cosa->name, cosa->firmware_status);
: + pr_notice("%s: start the firmware first (status %d)\n",
: + cosa->name, cosa->firmware_status);
: return -EPERM;
: }
: if (down_interruptible(&chan->wsem))
: @@ -881,8 +875,8 @@ static ssize_t cosa_write(struct file *file,
:
: /* Allocate the buffer */
: if ((kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA)) == NULL) {: - printk(KERN_NOTICE "%s: cosa_write() OOM - dropping packet\n",
: - cosa->name);
: + pr_notice("%s: cosa_write() OOM - dropping packet\n",
: + cosa->name);
: up(&chan->wsem); : return -ENOMEM; : }
: @@ -932,7 +926,7 @@ static int chrdev_tx_done(struct channel_data *chan, int size) :
: static unsigned int cosa_poll(struct file *file, poll_table *poll) : {
: - printk(KERN_INFO "cosa_poll is here\n");
: + pr_info("cosa_poll is here\n");
: return 0;
: }
:
: @@ -1017,15 +1011,14 @@ static inline int cosa_reset(struct cosa_data *cosa)
: {
: char idstring[COSA_MAX_ID_STRING];
: if (cosa->usage > 1)
: - printk(KERN_INFO "cosa%d: WARNING: reset requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: + pr_info("cosa%d: WARNING: reset requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: cosa->num, cosa->usage);
: cosa->firmware_status &= ~(COSA_FW_RESET|COSA_FW_START);
: if (cosa_reset_and_read_id(cosa, idstring) < 0) {: - printk(KERN_NOTICE "cosa%d: reset failed\n", cosa->num);
: + pr_notice("cosa%d: reset failed\n", cosa->num);
: return -EIO;
: }
: - printk(KERN_INFO "cosa%d: resetting device: %s\n", cosa->num,
: - idstring);
: + pr_info("cosa%d: resetting device: %s\n", cosa->num, idstring);
: cosa->firmware_status |= COSA_FW_RESET; : return 0; : }
: @@ -1037,11 +1030,11 @@ static inline int cosa_download(struct cosa_data *cosa, void __user *arg)
: int i;
:
: if (cosa->usage > 1)
: - printk(KERN_INFO "%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: + pr_info("%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: cosa->name, cosa->usage);
: if (!(cosa->firmware_status & COSA_FW_RESET)) {
: - printk(KERN_NOTICE "%s: reset the card first (status %d).\n",
: - cosa->name, cosa->firmware_status);
: + pr_notice("%s: reset the card first (status %d)\n",
: + cosa->name, cosa->firmware_status);
: return -EPERM; : } :
: @@ -1059,11 +1052,11 @@ static inline int cosa_download(struct cosa_data *cosa, void __user *arg) :
: i = download(cosa, d.code, d.len, d.addr);
: if (i < 0) {
: - printk(KERN_NOTICE "cosa%d: microcode download failed: %d\n",
: - cosa->num, i);
: + pr_notice("cosa%d: microcode download failed: %d\n",
: + cosa->num, i);
: return -EIO;
: }
: - printk(KERN_INFO "cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n",
: + pr_info("cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n",
: cosa->num, d.len, d.addr); : cosa->firmware_status |= COSA_FW_RESET|COSA_FW_DOWNLOAD; : return 0;
: @@ -1076,12 +1069,11 @@ static inline int cosa_readmem(struct cosa_data *cosa, void __user *arg)
: int i;
:
: if (cosa->usage > 1)
: - printk(KERN_INFO "cosa%d: WARNING: readmem requested with "
: - "cosa->usage > 1 (%d). Odd things may happen.\n",
: + pr_info("cosa%d: WARNING: readmem requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: cosa->num, cosa->usage);
: if (!(cosa->firmware_status & COSA_FW_RESET)) {
: - printk(KERN_NOTICE "%s: reset the card first (status %d).\n",
: - cosa->name, cosa->firmware_status);
: + pr_notice("%s: reset the card first (status %d)\n",
: + cosa->name, cosa->firmware_status);
: return -EPERM;
: }
:
: @@ -1093,11 +1085,10 @@ static inline int cosa_readmem(struct cosa_data *cosa, void __user *arg) :
: i = readmem(cosa, d.code, d.len, d.addr);
: if (i < 0) {
: - printk(KERN_NOTICE "cosa%d: reading memory failed: %d\n",
: - cosa->num, i);
: + pr_notice("cosa%d: reading memory failed: %d\n", cosa->num, i);
: return -EIO;
: }
: - printk(KERN_INFO "cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n",
: + pr_info("cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n",
: cosa->num, d.len, d.addr); : cosa->firmware_status |= COSA_FW_RESET; : return 0;
: @@ -1109,23 +1100,22 @@ static inline int cosa_start(struct cosa_data *cosa, int address)
: int i;
:
: if (cosa->usage > 1)
: - printk(KERN_INFO "cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: + pr_info("cosa%d: WARNING: start microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n",
: cosa->num, cosa->usage);
:
: if ((cosa->firmware_status & (COSA_FW_RESET|COSA_FW_DOWNLOAD))
: != (COSA_FW_RESET|COSA_FW_DOWNLOAD)) {
: - printk(KERN_NOTICE "%s: download the microcode and/or reset the card first (status %d).\n",
: - cosa->name, cosa->firmware_status);
: + pr_notice("%s: download the microcode and/or reset the card first (status %d)\n",
: + cosa->name, cosa->firmware_status);
: return -EPERM;
: }
: cosa->firmware_status &= ~COSA_FW_RESET;
: if ((i=startmicrocode(cosa, address)) < 0) {: - printk(KERN_NOTICE "cosa%d: start microcode at 0x%04x failed: %d\n",
: - cosa->num, address, i);
: + pr_notice("cosa%d: start microcode at 0x%04x failed: %d\n",
: + cosa->num, address, i);
: return -EIO;
: }
: - printk(KERN_INFO "cosa%d: starting microcode at 0x%04x\n",
: - cosa->num, address);
: + pr_info("cosa%d: starting microcode at 0x%04x\n", cosa->num, address);
: cosa->startaddr = address; : cosa->firmware_status |= COSA_FW_START; : return 0;
: @@ -1255,11 +1245,11 @@ static int cosa_start_tx(struct channel_data *chan, char *buf, int len) : #ifdef DEBUG_DATA
: int i;
:
: - printk(KERN_INFO "cosa%dc%d: starting tx(0x%x)", chan->cosa->num,
: - chan->num, len);
: + pr_info("cosa%dc%d: starting tx(0x%x)",
: + chan->cosa->num, chan->num, len);
: for (i=0; i<len; i++)
: - printk(" %02x", buf[i]&0xff);
: - printk("\n");
: + pr_cont(" %02x", buf[i]&0xff);
: + pr_cont("\n");
: #endif : spin_lock_irqsave(&cosa->lock, flags); : chan->txbuf = buf;
: @@ -1353,7 +1343,7 @@ static void cosa_kick(struct cosa_data *cosa)
: if (test_bit(TXBIT, &cosa->rxtx))
: s = "TX DMA";
:
: - printk(KERN_INFO "%s: %s timeout - restarting.\n", cosa->name, s);
: + pr_info("%s: %s timeout - restarting\n", cosa->name, s);
: spin_lock_irqsave(&cosa->lock, flags);
: cosa->rxtx = 0;
:
: @@ -1387,7 +1377,7 @@ static int cosa_dma_able(struct channel_data *chan, char *buf, int len)
: return 0;
: if ((b^ (b+len)) & 0x10000) {
: if (count++ < 5)
: - printk(KERN_INFO "%s: packet spanning a 64k boundary\n",
: + pr_info("%s: packet spanning a 64k boundary\n",
: chan->name);
: return 0;
: }
: @@ -1498,8 +1488,7 @@ static int readmem(struct cosa_data *cosa, char __user *microcode, int length, i
: char c;
: int i;
: if ((i=get_wait_data(cosa)) == -1) {
: - printk (KERN_INFO "cosa: 0x%04x bytes remaining\n",
: - length);
: + pr_info("0x%04x bytes remaining\n", length);
: return -11;
: }
: c=i;
: @@ -1582,14 +1571,15 @@ static int get_wait_data(struct cosa_data *cosa)
: short r;
: r = cosa_getdata8(cosa);
: #if 0
: - printk(KERN_INFO "cosa: get_wait_data returning after %d retries\n", 999-retries);
: + pr_info("get_wait_data returning after %d retries\n",
: + 999-retries);
: #endif
: return r;
: }
: /* sleep if not ready to read */
: schedule_timeout_interruptible(1);
: }
: - printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n",
: + pr_info("timeout in get_wait_data (status 0x%x)\n",
: cosa_getstatus(cosa));
: return -1;
: }
: @@ -1607,7 +1597,7 @@ static int put_wait_data(struct cosa_data *cosa, int data)
: if (cosa_getstatus(cosa) & SR_TX_RDY) {
: cosa_putdata8(cosa, data);
: #if 0
: - printk(KERN_INFO "Putdata: %d retries\n", 999-retries);
: + pr_info("Putdata: %d retries\n", 999-retries);
: #endif
: return 0;
: }
: @@ -1616,7 +1606,7 @@ static int put_wait_data(struct cosa_data *cosa, int data)
: schedule_timeout_interruptible(1);
: #endif
: }
: - printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n",
: + pr_info("cosa%d: timeout in put_wait_data (status 0x%x)\n",
: cosa->num, cosa_getstatus(cosa));
: return -1;
: }
: @@ -1636,13 +1626,13 @@ static int puthexnumber(struct cosa_data *cosa, int number)
: sprintf(temp, "%04X", number);
: for (i=0; i<4; i++) {
: if (put_wait_data(cosa, temp[i]) == -1) {: - printk(KERN_NOTICE "cosa%d: puthexnumber failed to write byte %d\n",
: - cosa->num, i);
: + pr_notice("cosa%d: puthexnumber failed to write byte %d\n",
: + cosa->num, i);
: return -1-2*i;
: }
: if (get_wait_data(cosa) != temp[i]) {: - printk(KERN_NOTICE "cosa%d: puthexhumber failed to read echo of byte %d\n",
: - cosa->num, i);
: + pr_notice("cosa%d: puthexhumber failed to read echo of byte %d\n",
: + cosa->num, i);
: return -2-2*i;
: }
: }
: @@ -1687,8 +1677,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)
: {
: unsigned long flags, flags1;
: #ifdef DEBUG_IRQS
: - printk(KERN_INFO "cosa%d: SR_DOWN_REQUEST status=0x%04x\n",
: - cosa->num, status);
: + pr_info("cosa%d: SR_DOWN_REQUEST status=0x%04x\n", cosa->num, status);
: #endif
: spin_lock_irqsave(&cosa->lock, flags);
: set_bit(TXBIT, &cosa->rxtx);
: @@ -1696,8 +1685,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)
: /* flow control, see the comment above */
: int i=0;
: if (!cosa->txbitmap) {
: - printk(KERN_WARNING "%s: No channel wants data "
: - "in TX IRQ. Expect DMA timeout.",
: + pr_warn("%s: No channel wants data in TX IRQ. Expect DMA timeout.\n",
: cosa->name);
: put_driver_status_nolock(cosa);
: clear_bit(TXBIT, &cosa->rxtx);
: @@ -1780,14 +1768,14 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)
: if (cosa->busmaster) {
: unsigned long addr = virt_to_bus(cosa->txbuf);
: int count=0;
: - printk(KERN_INFO "busmaster IRQ\n");
: + pr_info("busmaster IRQ\n");
: while (!(cosa_getstatus(cosa)&SR_TX_RDY)) {
: count++;
: udelay(10);
: if (count > 1000) break;
: }: - printk(KERN_INFO "status %x\n", cosa_getstatus(cosa));
: - printk(KERN_INFO "ready after %d loops\n", count);
: + pr_info("status %x\n", cosa_getstatus(cosa));
: + pr_info("ready after %d loops\n", count);
: cosa_putdata16(cosa, (addr >> 16)&0xffff);
:
: count = 0;
: @@ -1796,7 +1784,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)
: if (count > 1000) break;
: udelay(10);
: }
: - printk(KERN_INFO "ready after %d loops\n", count);
: + pr_info("ready after %d loops\n", count);
: cosa_putdata16(cosa, addr &0xffff);
: flags1 = claim_dma_lock();
: set_dma_mode(cosa->dma, DMA_MODE_CASCADE);
: @@ -1824,7 +1812,7 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status)
: {
: unsigned long flags;
: #ifdef DEBUG_IRQS: - printk(KERN_INFO "cosa%d: SR_UP_REQUEST\n", cosa->num);
: + pr_info("cosa%d: SR_UP_REQUEST\n", cosa->num);
: #endif
:
: spin_lock_irqsave(&cosa->lock, flags);
: @@ -1847,7 +1835,7 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status)
: debug_data_in(cosa, cosa->rxsize & 0xff);
: #endif
: #if 0
: - printk(KERN_INFO "cosa%d: receive rxsize = (0x%04x).\n",
: + pr_info("cosa%d: receive rxsize = (0x%04x)\n",
: cosa->num, cosa->rxsize);
: #endif
: }
: @@ -1857,12 +1845,12 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status)
: debug_data_in(cosa, cosa->rxsize);
: #endif
: #if 0
: - printk(KERN_INFO "cosa%d: receive rxsize = (0x%04x).\n",
: + pr_info("cosa%d: receive rxsize = (0x%04x)\n",
: cosa->num, cosa->rxsize);
: #endif
: }
: if (((cosa->rxsize & 0xe000) >> 13) >= cosa->nchannels) {
: - printk(KERN_WARNING "%s: rx for unknown channel (0x%04x)\n",
: + pr_warn("%s: rx for unknown channel (0x%04x)\n",
: cosa->name, cosa->rxsize);
: spin_unlock_irqrestore(&cosa->lock, flags);
: goto reject;: @@ -1877,7 +1865,7 @@ static inline void rx_interrupt(struct cosa_data *cosa, int status) :
: if (!cosa->rxbuf) {
: reject: /* Reject the packet */
: - printk(KERN_INFO "cosa%d: rejecting packet on channel %d\n",
: + pr_info("cosa%d: rejecting packet on channel %d\n",
: cosa->num, cosa->rxchan->num);
: cosa->rxbuf = cosa->bouncebuf;
: }
: @@ -1924,11 +1912,11 @@ static inline void eot_interrupt(struct cosa_data *cosa, int status)
: #ifdef DEBUG_DATA
: {
: int i;: - printk(KERN_INFO "cosa%dc%d: done rx(0x%x)", cosa->num,
: - cosa->rxchan->num, cosa->rxsize);
: + pr_info("cosa%dc%d: done rx(0x%x)",
: + cosa->num, cosa->rxchan->num, cosa->rxsize);
: for (i=0; i<cosa->rxsize; i++)
: - printk (" %02x", cosa->rxbuf[i]&0xff);
: - printk("\n");
: + pr_cont(" %02x", cosa->rxbuf[i]&0xff);
: + pr_cont("\n");
: }
: #endif
: /* Packet for unknown channel? */
: @@ -1940,8 +1928,7 @@ static inline void eot_interrupt(struct cosa_data *cosa, int status)
: if (cosa->rxchan->rx_done(cosa->rxchan))
: clear_bit(cosa->rxchan->num, &cosa->rxbitmap);
: } else {
: - printk(KERN_NOTICE "cosa%d: unexpected EOT interrupt\n",
: - cosa->num);
: + pr_notice("cosa%d: unexpected EOT interrupt\n", cosa->num);
: }
: /*
: * Clear the RXBIT, TXBIT and IRQBIT (the latest should be
: @@ -1963,8 +1950,7 @@ static irqreturn_t cosa_interrupt(int irq, void *cosa_)
: again:
: status = cosa_getstatus(cosa);
: #ifdef DEBUG_IRQS
: - printk(KERN_INFO "cosa%d: got IRQ, status 0x%02x\n", cosa->num,
: - status & 0xff);
: + pr_info("cosa%d: got IRQ, status 0x%02x\n", cosa->num, status & 0xff);
: #endif
: #ifdef DEBUG_IO
: debug_status_in(cosa, status);
: @@ -1985,15 +1971,15 @@ again:
: udelay(100);
: goto again;
: }
: - printk(KERN_INFO "cosa%d: unknown status 0x%02x in IRQ after %d retries\n",
: + pr_info("cosa%d: unknown status 0x%02x in IRQ after %d retries\n",
: cosa->num, status & 0xff, count);
: }
: #ifdef DEBUG_IRQS
: if (count): - printk(KERN_INFO "%s: %d-times got unknown status in IRQ\n",
: + pr_info("%s: %d-times got unknown status in IRQ\n",
: cosa->name, count);
: else
: - printk(KERN_INFO "%s: returning from IRQ\n", cosa->name);
: + pr_info("%s: returning from IRQ\n", cosa->name);
: #endif : return IRQ_HANDLED; : } : @@ -2024,41 +2010,41 @@ static void debug_status_in(struct cosa_data *cosa, int status) : s = "NO_REQ"; : break; : }
: - printk(KERN_INFO "%s: IO: status -> 0x%02x (%s%s%s%s)\n",
: + pr_info("%s: IO: status -> 0x%02x (%s%s%s%s)\n",
: cosa->name,
: status,
: - status & SR_USR_RQ ? "USR_RQ|":"", : - status & SR_TX_RDY ? "TX_RDY|":"", : - status & SR_RX_RDY ? "RX_RDY|":"", : + status & SR_USR_RQ ? "USR_RQ|" : "", : + status & SR_TX_RDY ? "TX_RDY|" : "", : + status & SR_RX_RDY ? "RX_RDY|" : "",
: s);
: }
:
: static void debug_status_out(struct cosa_data *cosa, int status) : {
: - printk(KERN_INFO "%s: IO: status <- 0x%02x (%s%s%s%s%s%s)\n",
: + pr_info("%s: IO: status <- 0x%02x (%s%s%s%s%s%s)\n",
: cosa->name,
: status,
: - status & SR_RX_DMA_ENA ? "RXDMA|":"!rxdma|", : - status & SR_TX_DMA_ENA ? "TXDMA|":"!txdma|", : - status & SR_RST ? "RESET|":"", : - status & SR_USR_INT_ENA ? "USRINT|":"!usrint|", : - status & SR_TX_INT_ENA ? "TXINT|":"!txint|", : - status & SR_RX_INT_ENA ? "RXINT":"!rxint"); : + status & SR_RX_DMA_ENA ? "RXDMA|" : "!rxdma|", : + status & SR_TX_DMA_ENA ? "TXDMA|" : "!txdma|", : + status & SR_RST ? "RESET|" : "", : + status & SR_USR_INT_ENA ? "USRINT|" : "!usrint|", : + status & SR_TX_INT_ENA ? "TXINT|" : "!txint|", : + status & SR_RX_INT_ENA ? "RXINT" : "!rxint");
: }
:
: static void debug_data_in(struct cosa_data *cosa, int data) : {
: - printk(KERN_INFO "%s: IO: data -> 0x%04x\n", cosa->name, data);
: + pr_info("%s: IO: data -> 0x%04x\n", cosa->name, data);
: }
:
: static void debug_data_out(struct cosa_data *cosa, int data) : {
: - printk(KERN_INFO "%s: IO: data <- 0x%04x\n", cosa->name, data);
: + pr_info("%s: IO: data <- 0x%04x\n", cosa->name, data);
: }
:
: static void debug_data_cmd(struct cosa_data *cosa, int data) : {
: - printk(KERN_INFO "%s: IO: data <- 0x%04x (%s|%s)\n",
: + pr_info("%s: IO: data <- 0x%04x (%s|%s)\n",
: cosa->name, data, : data & SR_RDY_RCV ? "RX_RDY" : "!rx_rdy", : data & SR_RDY_SND ? "TX_RDY" : "!tx_rdy");
: --
: 1.7.6.rc1
Signature · 5 lines
| Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/ Journal: http://www.fi.muni.cz/~kas/blog/ |
Please don't top post and in particular don't attach entire digests to your
mail or we'll all soon be using bittorrent to read the list. --Alan CoxPATCH 3/8 cyclom: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/cycx_drv.c | 81 +++++++++----------- drivers/net/wan/cycx_main.c | 31 ++++---- drivers/net/wan/cycx_x25.c | 177 ++++++++++++++++++++----------------------- 3 files changed, 133 insertions(+), 156 deletions(-)
drivers/net/wan/cycx_drv.c +37 -44
@@ -48,6 +48,8 @@* Aug 8, 1998 acme Initial version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> /* __init */ #include <linux/module.h> #include <linux/kernel.h> /* printk(), and other useful stuff */
@@ -81,10 +83,9 @@ static u16 checksum(u8 *buf, u32 len);/* Global Data */ /* private data */ -static const char modname[] ="cycx_drv" ;static const char fullname[] ="Cyclom 2X Support Module" ; -static const char copyright[] ="(c) 1998-2003 Arnaldo Carvalho de Melo " -"<[email protected]>" ; +static const char copyright[] = +"(c) 1998-2003 Arnaldo Carvalho de Melo <[email protected]>" ;/* Hardware configuration options. * These are arrays of configuration options used by verification routines.
@@ -110,8 +111,8 @@ static const long cycx_2x_irq_options[] = { 7, 3, 5, 9, 10, 11, 12, 15 };static int __init cycx_drv_init (void ) { -printk (KERN_INFO "%s v%u.%u %s\n" , fullname,MOD_VERSION ,MOD_RELEASE , - copyright); +pr_info ("%s v%u.%u %s\n" , + fullname,MOD_VERSION ,MOD_RELEASE , copyright);return 0 ; }
@@ -139,18 +140,16 @@ int cycx_setup(struct cycx_hw *hw, void *cfm, u32 len, unsigned long dpmbase)/* Verify IRQ configuration options */ if (!get_option_index (cycx_2x_irq_options, hw->irq)) { -printk (KERN_ERR "%s: IRQ %d is invalid!\n" , modname, hw->irq); +pr_err ("IRQ %d is invalid!\n" , hw->irq);return -EINVAL ; }/* Setup adapter dual-port memory window and test memory */ if (!dpmbase) { -printk (KERN_ERR "%s: you must specify the dpm address!\n" , - modname); +pr_err ("you must specify the dpm address!\n" );return -EINVAL ; }else if (!get_option_index (cyc2x_dpmbase_options, dpmbase)) { -printk (KERN_ERR "%s: memory address 0x%lX is invalid!\n" , - modname, dpmbase); +pr_err ("memory address 0x%lX is invalid!\n" , dpmbase);return -EINVAL ; }
@@ -158,13 +157,12 @@ int cycx_setup(struct cycx_hw *hw, void *cfm, u32 len, unsigned long dpmbase) hw->dpmsize =CYCX_WINDOWSIZE ;if (!detect_cyc2x (hw->dpmbase)) { -printk (KERN_ERR "%s: adapter Cyclom 2X not found at " -"address 0x%lX!\n" , modname, dpmbase); +pr_err ("adapter Cyclom 2X not found at address 0x%lX!\n" , + dpmbase);return -EINVAL ; } -printk (KERN_INFO "%s: found Cyclom 2X card at address 0x%lX.\n" , - modname, dpmbase); +pr_info ("found Cyclom 2X card at address 0x%lX\n" , dpmbase);/* Load firmware. If loader fails then shut down adapter */ err =load_cyc2x (hw, cfm, len);
@@ -339,7 +337,7 @@ static int cycx_data_boot(void __iomem *addr, u8 *code, u32 len)for (i =0 ; i < len ; i +=CFM_LOAD_BUFSZ )if (buffer_load (addr, code + i,min_t (u32,CFM_LOAD_BUFSZ , (len - i))) <0 ) { -printk (KERN_ERR "%s: Error !!\n" , modname); +pr_err ("Error !!\n" );return -1 ; }
@@ -370,7 +368,7 @@ static int cycx_code_boot(void __iomem *addr, u8 *code, u32 len)for (i =0 ; i < len ; i +=CFM_LOAD_BUFSZ )if (buffer_load (addr, code + i,min_t (u32,CFM_LOAD_BUFSZ , (len - i)))) { -printk (KERN_ERR "%s: Error !!\n" , modname); +pr_err ("Error !!\n" );return -1 ; }
@@ -391,23 +389,20 @@ static int load_cyc2x(struct cycx_hw *hw, struct cycx_firmware *cfm, u32 len)u16 cksum;/* Announce */ -printk (KERN_INFO "%s: firmware signature=\"%s\"\n" , modname, - cfm->signature); +pr_info ("firmware signature=\"%s\"\n" , cfm->signature);/* Verify firmware signature */ if (strcmp (cfm->signature,CFM_SIGNATURE )) { -printk (KERN_ERR "%s:load_cyc2x: not Cyclom-2X firmware!\n" , - modname); +pr_err ("load_cyc2x: not Cyclom-2X firmware!\n" );return -EINVAL ; } -printk (KERN_INFO "%s: firmware version=%u\n" , modname, cfm->version); +pr_info ("firmware version=%u\n" , cfm->version);/* Verify firmware module format version */ if (cfm->version !=CFM_VERSION ) { -printk (KERN_ERR "%s:%s: firmware format %u rejected! " -"Expecting %u.\n" , - modname, __func__, cfm->version,CFM_VERSION ); +pr_err ("%s: firmware format %u rejected! Expecting %u.\n" , + __func__, cfm->version,CFM_VERSION );return -EINVAL ; }
@@ -419,23 +414,22 @@ static int load_cyc2x(struct cycx_hw *hw, struct cycx_firmware *cfm, u32 len)if (((len - sizeof(struct cycx_firmware) - 1) != cfm->info.codesize) || */ if (cksum != cfm->checksum) { -printk (KERN_ERR "%s:%s: firmware corrupted!\n" , - modname, __func__); -printk (KERN_ERR " cdsize = 0x%x (expected 0x%lx)\n" , - len - (int )sizeof (struct cycx_firmware ) -1 , - cfm->info.codesize); -printk (KERN_ERR " chksum = 0x%x (expected 0x%x)\n" , - cksum, cfm->checksum); +pr_err ("%s: firmware corrupted!\n" , __func__); +pr_err (" cdsize = 0x%x (expected 0x%lx)\n" , + len - (int )sizeof (struct cycx_firmware ) -1 , + cfm->info.codesize); +pr_err (" chksum = 0x%x (expected 0x%x)\n" , + cksum, cfm->checksum);return -EINVAL ; }/* If everything is ok, set reset, data and code pointers */ img_hdr = (struct cycx_fw_header *)&cfm->image;#ifdef FIRMWARE_DEBUG -printk (KERN_INFO "%s:%s: image sizes\n" , __func__, modname); -printk (KERN_INFO " reset=%lu\n" , img_hdr->reset_size); -printk (KERN_INFO " data=%lu\n" , img_hdr->data_size); -printk (KERN_INFO " code=%lu\n" , img_hdr->code_size); +pr_info ("%s: image sizes\n" , __func__); +pr_info (" reset=%lu\n" , img_hdr->reset_size); +pr_info (" data=%lu\n" , img_hdr->data_size); +pr_info (" code=%lu\n" , img_hdr->code_size);#endif reset_image = ((u8 *)img_hdr) +sizeof (struct cycx_fw_header ); data_image = reset_image + img_hdr->reset_size;
@@ -443,15 +437,14 @@ static int load_cyc2x(struct cycx_hw *hw, struct cycx_firmware *cfm, u32 len)/*---- Start load ----*/ /* Announce */ -printk (KERN_INFO "%s: loading firmware %s (ID=%u)...\n" , modname, - cfm->descr[0 ] ? cfm->descr :"unknown firmware" , - cfm->info.codeid); +pr_info ("loading firmware %s (ID=%u)...\n" , + cfm->descr[0 ] ? cfm->descr :"unknown firmware" , + cfm->info.codeid);for (i =0 ; i <5 ; i++) {/* Reset Cyclom hardware */ if (!reset_cyc2x (hw->dpmbase)) { -printk (KERN_ERR "%s: dpm problem or board not found\n" , - modname); +pr_err ("dpm problem or board not found\n" );return -EINVAL ; }
@@ -468,19 +461,19 @@ static int load_cyc2x(struct cycx_hw *hw, struct cycx_firmware *cfm, u32 len)msleep_interruptible (1 *1000 ); } -printk (KERN_ERR "%s: reset not started.\n" , modname); +pr_err ("reset not started\n" );return -EINVAL ; reset_loaded:/* Load data.bin */ if (cycx_data_boot (hw->dpmbase, data_image, img_hdr->data_size)) { -printk (KERN_ERR "%s: cannot load data file.\n" , modname); +pr_err ("cannot load data file\n" );return -EINVAL ; }/* Load code.bin */ if (cycx_code_boot (hw->dpmbase, code_image, img_hdr->code_size)) { -printk (KERN_ERR "%s: cannot load code file.\n" , modname); +pr_err ("cannot load code file\n" );return -EINVAL ; }
@@ -493,7 +486,7 @@ reset_loaded:/* Arthur Ganzert's tip: wait a while after the firmware loading... seg abr 26 17:17:12 EST 1999 - acme */ msleep_interruptible (7 *1000 ); -printk (KERN_INFO "%s: firmware loaded!\n" , modname); +pr_info ("firmware loaded!\n" );/* enable interrupts */ cycx_inten (hw);
drivers/net/wan/cycx_main.c +14 -17
@@ -40,6 +40,8 @@* 1998/08/08 acme Initial version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/stddef.h> /* offsetof(), etc. */ #include <linux/errno.h> /* return codes */ #include <linux/string.h> /* inline memset(), etc. */
@@ -107,7 +109,7 @@ static int __init cycx_init(void) {int cnt, err = -ENOMEM ; -printk (KERN_INFO "%s v%u.%u %s\n" , +pr_info ("%s v%u.%u %s\n" , cycx_fullname,CYCX_DRV_VERSION ,CYCX_DRV_RELEASE , cycx_copyright);
@@ -133,9 +135,8 @@ static int __init cycx_init(void) err =register_wan_device (wandev);if (err) { -printk (KERN_ERR "%s: %s registration failed with " -"error %d!\n" , - cycx_drvname, card->devname, err); +pr_err ("%s registration failed with error %d!\n" , + card->devname, err);break ; } }
@@ -198,14 +199,13 @@ static int cycx_wan_setup(struct wan_device *wandev, wandev_conf_t *conf) rc = -EINVAL ;if (!conf->data_size || !conf->data) { -printk (KERN_ERR "%s: firmware not found in configuration " -"data!\n" , wandev->name); +pr_err ("%s: firmware not found in configuration data!\n" , + wandev->name); goto out; }if (conf->irq <=0 ) { -printk (KERN_ERR "%s: can't configure without IRQ!\n" , - wandev->name); +pr_err ("%s: can't configure without IRQ!\n" , wandev->name); goto out; }
@@ -213,8 +213,7 @@ static int cycx_wan_setup(struct wan_device *wandev, wandev_conf_t *conf) irq = conf->irq ==2 ?9 : conf->irq;/* IRQ2 -> IRQ9 */ if (request_irq (irq, cycx_isr,0 , wandev->name, card)) { -printk (KERN_ERR "%s: can't reserve IRQ %d!\n" , - wandev->name, irq); +pr_err ("%s: can't reserve IRQ %d!\n" , wandev->name, irq); goto out; }
@@ -246,8 +245,7 @@ static int cycx_wan_setup(struct wan_device *wandev, wandev_conf_t *conf)break ;#endif default : -printk (KERN_ERR "%s: this firmware is not supported!\n" , - wandev->name); +pr_err ("%s: this firmware is not supported!\n" , wandev->name); rc = -EINVAL ; }
@@ -288,8 +286,7 @@ static int cycx_wan_shutdown(struct wan_device *wandev) card = wandev->private; wandev->state =WAN_UNCONFIGURED ;cycx_down (&card->hw); -printk (KERN_INFO "%s: irq %d being freed!\n" , wandev->name, - wandev->irq); +pr_info ("%s: irq %d being freed!\n" , wandev->name, wandev->irq);free_irq (wandev->irq, card); out:return ret; }
@@ -308,8 +305,8 @@ static irqreturn_t cycx_isr(int irq, void *dev_id) goto out;if (card->in_isr) { -printk (KERN_WARNING "%s: interrupt re-entrancy on IRQ %d!\n" , - card->devname, card->wandev.irq); +pr_warn ("%s: interrupt re-entrancy on IRQ %d!\n" , + card->devname, card->wandev.irq); goto out; }
@@ -337,7 +334,7 @@ void cycx_set_state(struct cycx_device *card, int state) string_state ="disconnected!" ;break ; } -printk (KERN_INFO "%s: link %s\n" , card->devname, string_state); +pr_info ("%s: link %s\n" , card->devname, string_state); card->wandev.state = state; }
drivers/net/wan/cycx_x25.c +82 -95
325 lines not on this page · raw message
Signature · 1 line
1.7.6.rc1
PATCH 4/8 frame relay dlci/frad: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/dlci.c | 22 +++++++++++++------ drivers/net/wan/sdla.c | 52 +++++++++++++++++++++++++++-------------------- 2 files changed, 45 insertions(+), 29 deletions(-)
drivers/net/wan/dlci.c +15 -7
@@ -28,6 +28,8 @@* 2 of the License, or (at your option) any later version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h>
@@ -112,8 +114,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) dlp =netdev_priv (dev);if (!pskb_may_pull (skb,sizeof (*hdr))) { -printk (KERN_NOTICE "%s: invalid data no header\n" , - dev->name); +netdev_notice (dev,"invalid data no header\n" ); dev->stats.rx_errors++;kfree_skb (skb);return ;
@@ -126,7 +127,8 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)if (hdr->control !=FRAD_I_UI ) { -printk (KERN_NOTICE "%s: Invalid header flag 0x%02X.\n" , dev->name, hdr->control); +netdev_notice (dev,"Invalid header flag 0x%02X\n" , + hdr->control); dev->stats.rx_errors++; }else
@@ -135,14 +137,18 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)case FRAD_P_PADDING :if (hdr->NLPID !=FRAD_P_SNAP ) { -printk (KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n" , dev->name, hdr->NLPID); +netdev_notice (dev,"Unsupported NLPID 0x%02X\n" , + hdr->NLPID); dev->stats.rx_errors++;break ; }if (hdr->OUI[0 ] + hdr->OUI[1 ] + hdr->OUI[2 ] !=0 ) { -printk (KERN_NOTICE "%s: Unsupported organizationally unique identifier 0x%02X-%02X-%02X.\n" , dev->name, hdr->OUI[0 ], hdr->OUI[1 ], hdr->OUI[2 ]); +netdev_notice (dev,"Unsupported organizationally unique identifier 0x%02X-%02X-%02X\n" , + hdr->OUI[0 ], + hdr->OUI[1 ], + hdr->OUI[2 ]); dev->stats.rx_errors++;break ; }
@@ -163,12 +169,14 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)case FRAD_P_SNAP :case FRAD_P_Q933 :case FRAD_P_CLNP : -printk (KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n" , dev->name, hdr->pad); +netdev_notice (dev,"Unsupported NLPID 0x%02X\n" , + hdr->pad); dev->stats.rx_errors++;break ;default : -printk (KERN_NOTICE "%s: Invalid pad byte 0x%02X.\n" , dev->name, hdr->pad); +netdev_notice (dev,"Invalid pad byte 0x%02X\n" , + hdr->pad); dev->stats.rx_errors++;break ; }
drivers/net/wan/sdla.c +30 -22
151 lines not on this page · raw message
Signature · 1 line
1.7.6.rc1
PATCH 5/8 dscc4: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/dscc4.c | 80 ++++++++++++++++++++++------------------------ 1 files changed, 38 insertions(+), 42 deletions(-)
drivers/net/wan/dscc4.c +38 -42
@@ -80,6 +80,8 @@* - misc crapectomy. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/sched.h> #include <linux/types.h>
@@ -553,7 +555,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv,schedule_timeout_uninterruptible (10 );rmb (); }while (++i >0 ); -printk (KERN_ERR "%s: %s timeout\n" , dev->name, msg); +netdev_err (dev,"%s timeout\n" , msg); done:return (i >=0 ) ? i : -EAGAIN ; }
@@ -569,18 +571,18 @@ static int dscc4_do_action(struct net_device *dev, char *msg)u32 state =readl (ioaddr);if (state & ArAck) { -printk (KERN_DEBUG "%s: %s ack\n" , dev->name, msg); +netdev_dbg (dev,"%s ack\n" , msg);writel (ArAck, ioaddr); goto done; }else if (state & Arf) { -printk (KERN_ERR "%s: %s failed\n" , dev->name, msg); +netdev_err (dev,"%s failed\n" , msg);writel (Arf, ioaddr); i =-1 ; goto done; }rmb (); }while (++i >0 ); -printk (KERN_ERR "%s: %s timeout\n" , dev->name, msg); +netdev_err (dev,"%s timeout\n" , msg); done:return i; }
@@ -636,7 +638,7 @@ static void dscc4_tx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev)writel (MTFi|Rdt, dpriv->base_addr + dpriv->dev_id*0x0c +CH0CFG );if (dscc4_do_action (dev,"Rdt" ) <0 ) - printk(KERN_ERR "%s: Tx reset failed\n", dev->name); + netdev_err(dev, "Tx reset failed\n"); }#endif
@@ -722,22 +724,20 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, rc =pci_request_region (pdev,0 ,"registers" );if (rc <0 ) { -printk (KERN_ERR "%s: can't reserve MMIO region (regs)\n" , -DRV_NAME ); +pr_err ("can't reserve MMIO region (regs)\n" ); goto err_disable_0; } rc =pci_request_region (pdev,1 ,"LBI interface" );if (rc <0 ) { -printk (KERN_ERR "%s: can't reserve MMIO region (lbi)\n" , -DRV_NAME ); +pr_err ("can't reserve MMIO region (lbi)\n" ); goto err_free_mmio_region_1; } ioaddr =pci_ioremap_bar (pdev,0 );if (!ioaddr) { -printk (KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n" , -DRV_NAME , (unsigned long long )pci_resource_len (pdev,0 ), - (unsigned long long )pci_resource_start (pdev,0 )); +pr_err ("cannot remap MMIO region %llx @ %llx\n" , + (unsigned long long )pci_resource_len (pdev,0 ), + (unsigned long long )pci_resource_start (pdev,0 )); rc = -EIO ; goto err_free_mmio_regions_2; }
@@ -757,7 +757,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, rc =request_irq (pdev->irq, dscc4_irq,IRQF_SHARED ,DRV_NAME , priv->root);if (rc <0 ) { -printk (KERN_WARNING "%s: IRQ %d busy\n" ,DRV_NAME , pdev->irq); +pr_warn ("IRQ %d busy\n" , pdev->irq); goto err_release_4; }
@@ -904,7 +904,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr) root =kcalloc (dev_per_card,sizeof (*root),GFP_KERNEL );if (!root) { -printk (KERN_ERR "%s: can't allocate data\n" ,DRV_NAME ); +pr_err ("can't allocate data\n" ); goto err_out; }
@@ -916,7 +916,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr) ppriv =kzalloc (sizeof (*ppriv),GFP_KERNEL );if (!ppriv) { -printk (KERN_ERR "%s: can't allocate private data\n" ,DRV_NAME ); +pr_err ("can't allocate private data\n" ); goto err_free_dev; }
@@ -952,7 +952,7 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr) ret =register_hdlc_device (d);if (ret <0 ) { -printk (KERN_ERR "%s: unable to register\n" ,DRV_NAME ); +pr_err ("unable to register\n" );dscc4_release_ring (dpriv); goto err_unregister; }
@@ -1005,7 +1005,7 @@ static int dscc4_loopback_check(struct dscc4_dev_priv *dpriv)if (settings->loopback && (settings->clock_type !=CLOCK_INT )) {struct net_device *dev =dscc4_to_dev (dpriv); -printk (KERN_INFO "%s: loopback requires clock\n" , dev->name); +netdev_info (dev,"loopback requires clock\n" );return -1 ; }return 0 ;
@@ -1078,7 +1078,7 @@ static int dscc4_open(struct net_device *dev)scc_patchl (0 , PowerUp, dpriv, dev,CCR0 );scc_patchl (0 ,0x00050000 , dpriv, dev,CCR2 );scc_writel (EventsMask, dpriv, dev,IMR ); -printk (KERN_INFO "%s: up again.\n" , dev->name); +netdev_info (dev,"up again\n" ); goto done; }
@@ -1095,11 +1095,11 @@ static int dscc4_open(struct net_device *dev)* situations. */ if (scc_readl_star (dpriv, dev) & SccBusy) { -printk (KERN_ERR "%s busy. Try later\n" , dev->name); +netdev_err (dev,"busy - try later\n" ); ret = -EAGAIN ; goto err_out; }else -printk (KERN_INFO "%s: available. Good\n" , dev->name); +netdev_info (dev,"available - good\n" );scc_writel (EventsMask, dpriv, dev,IMR );
@@ -1117,7 +1117,7 @@ static int dscc4_open(struct net_device *dev)* reset is needed. Suggestions anyone ? */ if ((ret =dscc4_xpr_ack (dpriv)) <0 ) { -printk (KERN_ERR "%s: %s timeout\n" ,DRV_NAME ,"XPR" ); +pr_err ("XPR timeout\n" ); goto err_disable_scc_events; }
@@ -1342,8 +1342,7 @@ static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)return -EPERM ;if (dpriv->flags & FakeReset) { -printk (KERN_INFO "%s: please reset the device" -" before this command\n" , dev->name); +netdev_info (dev,"please reset the device before this command\n" );return -EPERM ; }if (copy_from_user (&dpriv->settings, line, size))
@@ -1506,8 +1505,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)writel (state, ioaddr +GSTAR );if (state & Arf) { -printk (KERN_ERR "%s: failure (Arf). Harass the maintener\n" , - dev->name); +netdev_err (dev,"failure (Arf). Harass the maintainer\n" ); goto out; } state &= ~ArAck;
@@ -1515,7 +1513,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)if (debug >0 )printk (KERN_DEBUG "%s: CfgIV\n" ,DRV_NAME );if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE ] &cpu_to_le32 (Arf)) -printk (KERN_ERR "%s: %s failed\n" , dev->name,"CFG" ); +netdev_err (dev,"CFG failed\n" );if (!(state &= ~Cfg)) goto out; }
@@ -1596,8 +1594,8 @@ try: ++dpriv->tx_dirty; }else {if (debug >1 ) -printk (KERN_ERR "%s Tx: NULL skb %d\n" , - dev->name, cur); +netdev_err (dev,"Tx: NULL skb %d\n" , + cur); }/* * If the driver ends sending crap on the wire, it
@@ -1616,7 +1614,7 @@ try:* Transmit Data Underrun */ if (state & Xdu) { -printk (KERN_ERR "%s: XDU. Ask maintainer\n" ,DRV_NAME ); +netdev_err (dev,"Tx Data Underrun. Ask maintainer\n" ); dpriv->flags = NeedIDT;/* Tx reset */ writel(MTFi | Rdt,
@@ -1625,13 +1623,13 @@ try:return ; }if (state & Cts) { -printk (KERN_INFO "%s: CTS transition\n" , dev->name); +netdev_info (dev,"CTS transition\n" );if (!(state &= ~Cts))/* DEBUG */ goto try; }if (state & Xmr) {/* Frame needs to be sent again - FIXME */ -printk (KERN_ERR "%s: Xmr. Ask maintainer\n" ,DRV_NAME ); +netdev_err (dev,"Tx ReTx. Ask maintainer\n" );if (!(state &= ~Xmr))/* DEBUG */ goto try; }
@@ -1649,7 +1647,7 @@ try:break ; }if (!i) -printk (KERN_INFO "%s busy in irq\n" , dev->name); +netdev_info (dev,"busy in irq\n" ); scc_addr = dpriv->base_addr +0x0c *dpriv->dev_id;/* Keep this order: IDT before IDR */
@@ -1686,7 +1684,7 @@ try: }if (state & Cd) {if (debug >0 ) -printk (KERN_INFO "%s: CD transition\n" , dev->name); +netdev_info (dev,"CD transition\n" );if (!(state &= ~Cd))/* DEBUG */ goto try; }
@@ -1695,11 +1693,11 @@ try:#ifdef DSCC4_POLLING while (!dscc4_tx_poll (dpriv, dev));#endif -printk (KERN_INFO "%s: Tx Hi\n" , dev->name); +netdev_info (dev,"Tx Hi\n" ); state &= ~Hi; }if (state & Err) { -printk (KERN_INFO "%s: Tx ERR\n" , dev->name); +netdev_info (dev,"Tx ERR\n" ); dev->stats.tx_errors++; state &= ~Err; }
@@ -1769,7 +1767,7 @@ try: goto try; }if (state & Hi ) {/* HI bit */ -printk (KERN_INFO "%s: Rx Hi\n" , dev->name); +netdev_info (dev,"Rx Hi\n" ); state &= ~Hi; goto try; }
@@ -1800,7 +1798,7 @@ try: goto try; }if (state & Cts) { -printk (KERN_INFO "%s: CTS transition\n" , dev->name); +netdev_info (dev,"CTS transition\n" );if (!(state &= ~Cts))/* DEBUG */ goto try; }
@@ -1859,14 +1857,12 @@ try: sizeof(struct RxFD), scc_addr + CH0BRDA);writel (MTFi|Rdr|Idr, scc_addr +CH0CFG );if (dscc4_do_action (dev,"RDR" ) <0 ) { -printk (KERN_ERR "%s: RDO recovery failed(%s)\n" , - dev->name,"RDR" ); +netdev_err (dev,"RDO recovery failed(RDR)\n" ); goto rdo_end; }writel (MTFi|Idr, scc_addr +CH0CFG );if (dscc4_do_action (dev,"IDR" ) <0 ) { -printk (KERN_ERR "%s: RDO recovery failed(%s)\n" , - dev->name,"IDR" ); +netdev_err (dev,"RDO recovery failed(IDR)\n" ); goto rdo_end; } rdo_end:
@@ -1875,7 +1871,7 @@ try: goto try; }if (state & Cd) { -printk (KERN_INFO "%s: CD transition\n" , dev->name); +netdev_info (dev,"CD transition\n" );if (!(state &= ~Cd))/* DEBUG */ goto try; }
Signature · 1 line
1.7.6.rc1
PATCH 6/8 farsync: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/farsync.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/wan/farsync.c +3 -4
@@ -1665,10 +1665,9 @@ check_started_ok(struct fst_card_info *card)* existing firmware etc so we just report it for the moment. */ if (FST_RDL (card, numberOfPorts) != card->nports) { -pr_warning ("Port count mismatch on card %d. " -"Firmware thinks %d we say %d\n" , - card->card_no, -FST_RDL (card, numberOfPorts), card->nports); +pr_warn ("Port count mismatch on card %d. Firmware thinks %d we say %d\n" , + card->card_no, +FST_RDL (card, numberOfPorts), card->nports); } }
Signature · 1 line
1.7.6.rc1
PATCH 7/8 ixp4xx_hss: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/ixp4xx_hss.c | 28 +++++++++++++--------------- 1 files changed, 13 insertions(+), 15 deletions(-)
drivers/net/wan/ixp4xx_hss.c +13 -15
@@ -8,6 +8,8 @@* as published by the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/bitops.h> #include <linux/cdev.h> #include <linux/dma-mapping.h>
@@ -358,9 +360,8 @@ static void hss_npe_send(struct port *port, struct msg *msg, const char* what) {u32 *val = (u32 *)msg;if (npe_send_message (port->npe, msg, what)) { -printk (KERN_CRIT "HSS-%i: unable to send command [%08X:%08X]" -" to %s\n" , port->id, val[0 ], val[1 ], -npe_name (port->npe)); +pr_crit ("HSS-%i: unable to send command [%08X:%08X] to %s\n" , + port->id, val[0 ], val[1 ],npe_name (port->npe));BUG (); } }
@@ -447,8 +448,7 @@ static void hss_config(struct port *port)if (npe_recv_message (port->npe, &msg,"HSS_LOAD_CONFIG" ) ||/* HSS_LOAD_CONFIG for port #1 returns port_id = #4 */ msg.cmd !=PORT_CONFIG_LOAD || msg.data32) { -printk (KERN_CRIT "HSS-%i: HSS_LOAD_CONFIG failed\n" , - port->id); +pr_crit ("HSS-%i: HSS_LOAD_CONFIG failed\n" , port->id);BUG (); }
@@ -477,8 +477,7 @@ static u32 hss_get_status(struct port *port) msg.hss_port = port->id;hss_npe_send (port, &msg,"PORT_ERROR_READ" );if (npe_recv_message (port->npe, &msg,"PORT_ERROR_READ" )) { -printk (KERN_CRIT "HSS-%i: unable to read HSS status\n" , - port->id); +pr_crit ("HSS-%i: unable to read HSS status\n" , port->id);BUG (); }
@@ -736,9 +735,8 @@ static int hss_hdlc_poll(struct napi_struct *napi, int budget) dev->stats.rx_errors++;break ;default :/* FIXME - remove printk */ -printk (KERN_ERR "%s: hss_hdlc_poll: status 0x%02X" -" errors %u\n" , dev->name, desc->status, - desc->error_count); +netdev_err (dev,"hss_hdlc_poll: status 0x%02X errors %u\n" , + desc->status, desc->error_count); dev->stats.rx_errors++; }
@@ -1127,8 +1125,8 @@ static int hss_hdlc_close(struct net_device *dev) buffs--;if (buffs) -printk (KERN_CRIT "%s: unable to drain RX queue, %i buffer(s)" -" left in NPE\n" , dev->name, buffs); +netdev_crit (dev,"unable to drain RX queue, %i buffer(s) left in NPE\n" , + buffs); buffs =TX_DESCS ;while (queue_get_desc (queue_ids[port->id].tx, port,1 ) >=0 )
@@ -1143,8 +1141,8 @@ static int hss_hdlc_close(struct net_device *dev) }while (++i <MAX_CLOSE_WAIT );if (buffs) -printk (KERN_CRIT "%s: unable to drain TX queue, %i buffer(s) " -"left in NPE\n" , dev->name, buffs); +netdev_crit (dev,"unable to drain TX queue, %i buffer(s) left in NPE\n" , + buffs);#if DEBUG_CLOSE if (!buffs)printk (KERN_DEBUG "Draining TX queues took %i cycles\n" , i);
@@ -1364,7 +1362,7 @@ static int __devinit hss_init_one(struct platform_device *pdev)platform_set_drvdata (pdev, port); -printk (KERN_INFO "%s: HSS-%i\n" , dev->name, port->id); +netdev_info (dev,"HSS-%i\n" , port->id);return 0 ; err_free_netdev:
Signature · 1 line
1.7.6.rc1
PATCH 8/8 wan: Update to current logging forms
In reply to Joe PerchesUse pr_fmt, pr_<level> and netdev_<level> as appropriate.
--- drivers/net/wan/hostess_sv11.c | 11 +++--- drivers/net/wan/lapbether.c | 18 +++++----- drivers/net/wan/pc300_drv.c | 4 ++- drivers/net/wan/sbni.c | 67 +++++++++++++++++++--------------------- drivers/net/wan/sealevel.c | 11 +++--- drivers/net/wan/x25_asy.c | 47 ++++++++++++++-------------- drivers/net/wan/z85230.c | 34 ++++++++++---------- 7 files changed, 96 insertions(+), 96 deletions(-)
drivers/net/wan/hostess_sv11.c +6 -5
@@ -20,6 +20,8 @@* Generic HDLC port Copyright (C) 2008 Krzysztof Halasa <[email protected]> */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h>
@@ -192,8 +194,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)*/ if (!request_region (iobase,8 ,"Comtrol SV11" )) { -printk (KERN_WARNING "hostess: I/O 0x%X already in use.\n" , - iobase); +pr_warn ("I/O 0x%X already in use\n" , iobase);return NULL ; }
@@ -221,7 +222,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)if (request_irq (irq, z8530_interrupt,IRQF_DISABLED ,"Hostess SV11" , sv) <0 ) { -printk (KERN_WARNING "hostess: IRQ %d already in use.\n" , irq); +pr_warn ("IRQ %d already in use\n" , irq); goto err_irq; }
@@ -255,7 +256,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)*/ if (z8530_init (sv)) { -printk (KERN_ERR "Z8530 series device not found.\n" ); +pr_err ("Z8530 series device not found\n" );enable_irq (irq); goto free_dma; }
@@ -282,7 +283,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq) netdev->irq = irq;if (register_hdlc_device (netdev)) { -printk (KERN_ERR "hostess: unable to register HDLC device.\n" ); +pr_err ("unable to register HDLC device\n" );free_netdev (netdev); goto free_dma; }
drivers/net/wan/lapbether.c +9 -9
@@ -20,6 +20,8 @@* 2000-11-14 Henner Eisen dev_hold/put, NETDEV_GOING_DOWN support */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h>
@@ -165,13 +167,11 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,break ;case X25_IFACE_CONNECT :if ((err =lapb_connect_request (dev)) !=LAPB_OK ) -printk (KERN_ERR "lapbeth: lapb_connect_request " -"error: %d\n" , err); +pr_err ("lapb_connect_request error: %d\n" , err); goto drop;case X25_IFACE_DISCONNECT :if ((err =lapb_disconnect_request (dev)) !=LAPB_OK ) -printk (KERN_ERR "lapbeth: lapb_disconnect_request " -"err: %d\n" , err); +pr_err ("lapb_disconnect_request err: %d\n" , err);/* Fall thru */ default : goto drop;
@@ -180,7 +180,7 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,skb_pull (skb,1 );if ((err =lapb_data_request (dev, skb)) !=LAPB_OK ) { -printk (KERN_ERR "lapbeth: lapb_data_request error - %d\n" , err); +pr_err ("lapb_data_request error - %d\n" , err); goto drop; } out:
@@ -220,7 +220,7 @@ static void lapbeth_connected(struct net_device *dev, int reason)struct sk_buff *skb =dev_alloc_skb (1 );if (!skb) { -printk (KERN_ERR "lapbeth: out of memory\n" ); +pr_err ("out of memory\n" );return ; }
@@ -237,7 +237,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)struct sk_buff *skb =dev_alloc_skb (1 );if (!skb) { -printk (KERN_ERR "lapbeth: out of memory\n" ); +pr_err ("out of memory\n" );return ; }
@@ -277,7 +277,7 @@ static int lapbeth_open(struct net_device *dev)int err;if ((err =lapb_register (dev, &lapbeth_callbacks)) !=LAPB_OK ) { -printk (KERN_ERR "lapbeth: lapb_register error - %d\n" , err); +pr_err ("lapb_register error: %d\n" , err);return -ENODEV ; }
@@ -292,7 +292,7 @@ static int lapbeth_close(struct net_device *dev)netif_stop_queue (dev);if ((err =lapb_unregister (dev)) !=LAPB_OK ) -printk (KERN_ERR "lapbeth: lapb_unregister error - %d\n" , err); +pr_err ("lapb_unregister error: %d\n" , err);return 0 ; }
drivers/net/wan/pc300_drv.c +3 -1
@@ -212,6 +212,8 @@ static const char rcsid[] =* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h>
@@ -3242,7 +3244,7 @@ static inline void show_version(void) rcsdate++; tmp =strrchr (rcsdate,' ' ); *tmp ='\0' ; -printk (KERN_INFO "Cyclades-PC300 driver %s %s\n" , rcsvers, rcsdate); +pr_info ("Cyclades-PC300 driver %s %s\n" , rcsvers, rcsdate); }/* show_version */ static const struct net_device_ops cpc_netdev_ops = {
drivers/net/wan/sbni.c +32 -35
167 lines not on this page · raw message
drivers/net/wan/sealevel.c +6 -5
@@ -12,6 +12,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h>
@@ -190,7 +192,7 @@ static int slvl_setup(struct slvl_device *sv, int iobase, int irq) dev->irq = irq;if (register_hdlc_device (dev)) { -printk (KERN_ERR "sealevel: unable to register HDLC device\n" ); +pr_err ("unable to register HDLC device\n" );free_netdev (dev);return -1 ; }
@@ -215,8 +217,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,*/ if (!request_region (iobase,8 ,"Sealevel 4021" )) { -printk (KERN_WARNING "sealevel: I/O 0x%X already in use.\n" , - iobase); +pr_warn ("I/O 0x%X already in use\n" , iobase);return NULL ; }
@@ -267,7 +268,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,if (request_irq (irq, z8530_interrupt,IRQF_DISABLED ,"SeaLevel" , dev) <0 ) { -printk (KERN_WARNING "sealevel: IRQ %d already in use.\n" , irq); +pr_warn ("IRQ %d already in use\n" , irq); goto err_request_irq; }
@@ -292,7 +293,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,*/ if (z8530_init (dev) !=0 ) { -printk (KERN_ERR "Z8530 series device not found.\n" ); +pr_err ("Z8530 series device not found\n" );enable_irq (irq); goto free_hw; }
drivers/net/wan/x25_asy.c +23 -24
140 lines not on this page · raw message
drivers/net/wan/z85230.c +17 -17
@@ -36,6 +36,8 @@* Synchronous mode without DMA is unlikely to pass about 2400 baud. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h>
@@ -365,7 +367,7 @@ static void z8530_rx(struct z8530_channel *c) c->count=0 ;if (stat&Rx_OVR) { -printk (KERN_WARNING "%s: overrun\n" , c->dev->name); +pr_warn ("%s: overrun\n" , c->dev->name); c->rx_overrun++; }if (stat&CRC_ERR )
@@ -464,12 +466,12 @@ static void z8530_status(struct z8530_channel *chan)if (altered & chan->dcdcheck) {if (status & chan->dcdcheck) { -printk (KERN_INFO "%s: DCD raised\n" , chan->dev->name); +pr_info ("%s: DCD raised\n" , chan->dev->name);write_zsreg (chan,R3 , chan->regs[3 ] | RxENABLE);if (chan->netdevice)netif_carrier_on (chan->netdevice); }else { -printk (KERN_INFO "%s: DCD lost\n" , chan->dev->name); +pr_info ("%s: DCD lost\n" , chan->dev->name);write_zsreg (chan,R3 , chan->regs[3 ] & ~RxENABLE);z8530_flush_fifo (chan);if (chan->netdevice)
@@ -538,12 +540,12 @@ static void z8530_dma_tx(struct z8530_channel *chan) {if (!chan->dma_tx) { -printk (KERN_WARNING "Hey who turned the DMA off?\n" ); +pr_warn ("Hey who turned the DMA off?\n" );z8530_tx (chan);return ; }/* This shouldn't occur in DMA mode */ -printk (KERN_ERR "DMA tx - bogus event!\n" ); +pr_err ("DMA tx - bogus event!\n" );z8530_tx (chan); }
@@ -585,12 +587,12 @@ static void z8530_dma_status(struct z8530_channel *chan)if (altered & chan->dcdcheck) {if (status & chan->dcdcheck) { -printk (KERN_INFO "%s: DCD raised\n" , chan->dev->name); +pr_info ("%s: DCD raised\n" , chan->dev->name);write_zsreg (chan,R3 , chan->regs[3 ] | RxENABLE);if (chan->netdevice)netif_carrier_on (chan->netdevice); }else { -printk (KERN_INFO "%s:DCD lost\n" , chan->dev->name); +pr_info ("%s: DCD lost\n" , chan->dev->name);write_zsreg (chan,R3 , chan->regs[3 ] & ~RxENABLE);z8530_flush_fifo (chan);if (chan->netdevice)
@@ -712,7 +714,7 @@ irqreturn_t z8530_interrupt(int irq, void *dev_id)if (locker) { -printk (KERN_ERR "IRQ re-enter\n" ); +pr_err ("IRQ re-enter\n" );return IRQ_NONE ; } locker=1 ;
@@ -758,7 +760,8 @@ irqreturn_t z8530_interrupt(int irq, void *dev_id) }spin_unlock (&dev->lock);if (work==5000 ) -printk (KERN_ERR "%s: interrupt jammed - abort(0x%X)!\n" , dev->name, intr); +pr_err ("%s: interrupt jammed - abort(0x%X)!\n" , + dev->name, intr);/* Ok all done */ locker=0 ;return IRQ_HANDLED ;
@@ -1225,7 +1228,7 @@ static const char *z8530_type_name[]={void z8530_describe (struct z8530_dev *dev,char *mapping,unsigned long io) { - printk(KERN_INFO "%s: %s found at %s 0x%lX, IRQ %d.\n", + pr_info("%s: %s found at %s 0x%lX, IRQ %d\n", dev->name, z8530_type_name[dev->type], mapping,
@@ -1621,8 +1624,7 @@ static void z8530_rx_done(struct z8530_channel *c)else /* Can't occur as we dont reenable the DMA irq until after the flip is done */ -printk (KERN_WARNING "%s: DMA flip overrun!\n" , - c->netdevice->name); +netdev_warn (c->netdevice,"DMA flip overrun!\n" );release_dma_lock (flags);
@@ -1637,8 +1639,7 @@ static void z8530_rx_done(struct z8530_channel *c) skb =dev_alloc_skb (ct);if (skb ==NULL ) { c->netdevice->stats.rx_dropped++; -printk (KERN_WARNING "%s: Memory squeeze.\n" , - c->netdevice->name); +netdev_warn (c->netdevice,"Memory squeeze\n" ); }else {skb_put (skb, ct);skb_copy_to_linear_data (skb, rxb, ct);
@@ -1678,8 +1679,7 @@ static void z8530_rx_done(struct z8530_channel *c) c->skb2 =dev_alloc_skb (c->mtu);if (c->skb2 ==NULL ) -printk (KERN_WARNING "%s: memory squeeze.\n" , - c->netdevice->name); +netdev_warn (c->netdevice,"memory squeeze\n" );else skb_put (c->skb2, c->mtu); c->netdevice->stats.rx_packets++;
@@ -1693,7 +1693,7 @@ static void z8530_rx_done(struct z8530_channel *c) c->rx_function (c, skb); }else { c->netdevice->stats.rx_dropped++; -printk (KERN_ERR "%s: Lost a frame\n" , c->netdevice->name); +netdev_err (c->netdevice,"Lost a frame\n" ); } }
Signature · 1 line
1.7.6.rc1
David Miller
maintainerFrom: Joe Perches <[email protected]>
Date: Sun, 26 Jun 2011 22:01:27 -0700
Quoted 9 lines
Joe Perches (8):
generic_hdlc: Update to current logging forms
cosa: Update to current logging forms
cyclom: Update to current logging forms
frame relay dlci/frad: Update to current logging forms
dscc4: Update to current logging forms
farsync: Update to current logging forms
ixp4xx_hss: Update to current logging forms
wan: Update to current logging forms
All applied, thanks Joe.