net/usb/pegasus.c -- avoid hundreds of diagnostics
Subsystems (4)
PATCH 1/1 net/usb/pegasus.c -- avoid hundreds of diagnostics
From: David Brownell <[email protected]>
Make the "pegasus" driver scream less loudly in the face of problems as it initializes, avoiding hundreds of messages:
- ratelimit some key error messages
- avoid some spurious diagnostics caused by strange codeflow
And fix one instance of goofy indentation.
Signed-off-by David Brownell <[email protected]>
drivers/net/usb/pegasus.c +6 -5
@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb)case -ENOENT :break ;default : -if (netif_msg_drv (pegasus)) +if (netif_msg_drv (pegasus) &&printk_ratelimit ())dev_dbg (&pegasus->intf->dev,"%s, status %d\n" , __FUNCTION__, urb->status); }
@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,set_current_state (TASK_RUNNING );if (ret == -ENODEV )netif_device_detach (pegasus->net); -if (netif_msg_drv (pegasus)) +if (netif_msg_drv (pegasus) &&printk_ratelimit ())dev_err (&pegasus->intf->dev,"%s, status %d\n" , __FUNCTION__, ret); goto out;
@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)if ((ret =usb_submit_urb (pegasus->ctrl_urb,GFP_ATOMIC ))) {if (ret == -ENODEV )netif_device_detach (pegasus->net); -if (netif_msg_drv (pegasus)) +if (netif_msg_drv (pegasus) &&printk_ratelimit ())dev_err (&pegasus->intf->dev,"%s, status %d\n" , __FUNCTION__, ret); goto out;
@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net) pegasus->eth_regs[EthCtrl2] |=RX_PROMISCUOUS ;if (netif_msg_link (pegasus))pr_info ("%s: Promiscuous mode enabled.\n" , net->name); - }else if (net->mc_count || - (net->flags &IFF_ALLMULTI )) { + }else if (net->mc_count || (net->flags &IFF_ALLMULTI )) { pegasus->eth_regs[EthCtrl0] |=RX_MULTICAST ; pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS ;if (netif_msg_link (pegasus))
@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net) pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS ; } + pegasus->ctrl_urb->status =0 ; + pegasus->flags |=ETH_REGS_CHANGE ;ctrl_callback (pegasus->ctrl_urb); }
Jeff Garzik
AppliedQuoted 11 lines · David Brownell
From: David Brownell <[email protected]>
Make the "pegasus" driver scream less loudly in the face of problems as it initializes, avoiding hundreds of messages:
- ratelimit some key error messages
- avoid some spurious diagnostics caused by strange codeflowAnd fix one instance of goofy indentation.
Signed-off-by David Brownell <[email protected]>
applied