usbnet: remove direct access to urb->status

USB drivers should not use urb->status directly because
it is scheduled to become a parameter. This does the conversion
for drivers/net/usb

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Oliver Neukum 2010-07-02 15:51:55 +02:00 committed by David S. Miller
parent 396e799c3a
commit c31fd6c25c
2 changed files with 12 additions and 9 deletions

View File

@ -97,8 +97,9 @@ static void tx_complete(struct urb *req)
struct sk_buff *skb = req->context; struct sk_buff *skb = req->context;
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct usbpn_dev *pnd = netdev_priv(dev); struct usbpn_dev *pnd = netdev_priv(dev);
int status = req->status;
switch (req->status) { switch (status) {
case 0: case 0:
dev->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
break; break;
@ -109,7 +110,7 @@ static void tx_complete(struct urb *req)
dev->stats.tx_aborted_errors++; dev->stats.tx_aborted_errors++;
default: default:
dev->stats.tx_errors++; dev->stats.tx_errors++;
dev_dbg(&dev->dev, "TX error (%d)\n", req->status); dev_dbg(&dev->dev, "TX error (%d)\n", status);
} }
dev->stats.tx_packets++; dev->stats.tx_packets++;
@ -150,8 +151,9 @@ static void rx_complete(struct urb *req)
struct page *page = virt_to_page(req->transfer_buffer); struct page *page = virt_to_page(req->transfer_buffer);
struct sk_buff *skb; struct sk_buff *skb;
unsigned long flags; unsigned long flags;
int status = req->status;
switch (req->status) { switch (status) {
case 0: case 0:
spin_lock_irqsave(&pnd->rx_lock, flags); spin_lock_irqsave(&pnd->rx_lock, flags);
skb = pnd->rx_skb; skb = pnd->rx_skb;

View File

@ -193,7 +193,7 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
case 0: case 0:
break; break;
default: default:
err("%s: urb status: %d", __func__, urb->status); err("%s: urb status: %d", __func__, status);
return; return;
} }
@ -222,16 +222,17 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
static void ipheth_sndbulk_callback(struct urb *urb) static void ipheth_sndbulk_callback(struct urb *urb)
{ {
struct ipheth_device *dev; struct ipheth_device *dev;
int status = urb->status;
dev = urb->context; dev = urb->context;
if (dev == NULL) if (dev == NULL)
return; return;
if (urb->status != 0 && if (status != 0 &&
urb->status != -ENOENT && status != -ENOENT &&
urb->status != -ECONNRESET && status != -ECONNRESET &&
urb->status != -ESHUTDOWN) status != -ESHUTDOWN)
err("%s: urb status: %d", __func__, urb->status); err("%s: urb status: %d", __func__, status);
dev_kfree_skb_irq(dev->tx_skb); dev_kfree_skb_irq(dev->tx_skb);
netif_wake_queue(dev->net); netif_wake_queue(dev->net);