aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2010-07-02 09:51:55 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-05 21:50:55 -0400
commitc31fd6c25c4619c0745b12cff842721a4bd4202c (patch)
tree2f2c0efc80a2bcb949d06a20f738068c63fcd516 /drivers
parent396e799c3ac29f970c40bde87b76f4652c06df76 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/cdc-phonet.c8
-rw-r--r--drivers/net/usb/ipheth.c13
2 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index dc9444525b49..109751bad3bb 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -97,8 +97,9 @@ static void tx_complete(struct urb *req)
97 struct sk_buff *skb = req->context; 97 struct sk_buff *skb = req->context;
98 struct net_device *dev = skb->dev; 98 struct net_device *dev = skb->dev;
99 struct usbpn_dev *pnd = netdev_priv(dev); 99 struct usbpn_dev *pnd = netdev_priv(dev);
100 int status = req->status;
100 101
101 switch (req->status) { 102 switch (status) {
102 case 0: 103 case 0:
103 dev->stats.tx_bytes += skb->len; 104 dev->stats.tx_bytes += skb->len;
104 break; 105 break;
@@ -109,7 +110,7 @@ static void tx_complete(struct urb *req)
109 dev->stats.tx_aborted_errors++; 110 dev->stats.tx_aborted_errors++;
110 default: 111 default:
111 dev->stats.tx_errors++; 112 dev->stats.tx_errors++;
112 dev_dbg(&dev->dev, "TX error (%d)\n", req->status); 113 dev_dbg(&dev->dev, "TX error (%d)\n", status);
113 } 114 }
114 dev->stats.tx_packets++; 115 dev->stats.tx_packets++;
115 116
@@ -150,8 +151,9 @@ static void rx_complete(struct urb *req)
150 struct page *page = virt_to_page(req->transfer_buffer); 151 struct page *page = virt_to_page(req->transfer_buffer);
151 struct sk_buff *skb; 152 struct sk_buff *skb;
152 unsigned long flags; 153 unsigned long flags;
154 int status = req->status;
153 155
154 switch (req->status) { 156 switch (status) {
155 case 0: 157 case 0:
156 spin_lock_irqsave(&pnd->rx_lock, flags); 158 spin_lock_irqsave(&pnd->rx_lock, flags);
157 skb = pnd->rx_skb; 159 skb = pnd->rx_skb;
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 197c352c47fb..08e7b6abacdd 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -193,7 +193,7 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
193 case 0: 193 case 0:
194 break; 194 break;
195 default: 195 default:
196 err("%s: urb status: %d", __func__, urb->status); 196 err("%s: urb status: %d", __func__, status);
197 return; 197 return;
198 } 198 }
199 199
@@ -222,16 +222,17 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
222static void ipheth_sndbulk_callback(struct urb *urb) 222static void ipheth_sndbulk_callback(struct urb *urb)
223{ 223{
224 struct ipheth_device *dev; 224 struct ipheth_device *dev;
225 int status = urb->status;
225 226
226 dev = urb->context; 227 dev = urb->context;
227 if (dev == NULL) 228 if (dev == NULL)
228 return; 229 return;
229 230
230 if (urb->status != 0 && 231 if (status != 0 &&
231 urb->status != -ENOENT && 232 status != -ENOENT &&
232 urb->status != -ECONNRESET && 233 status != -ECONNRESET &&
233 urb->status != -ESHUTDOWN) 234 status != -ESHUTDOWN)
234 err("%s: urb status: %d", __func__, urb->status); 235 err("%s: urb status: %d", __func__, status);
235 236
236 dev_kfree_skb_irq(dev->tx_skb); 237 dev_kfree_skb_irq(dev->tx_skb);
237 netif_wake_queue(dev->net); 238 netif_wake_queue(dev->net);