aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-04-12 07:17:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:38 -0400
commit997ea58eb92f9970b8af7aae48800d0ef43b9423 (patch)
tree65e021973e5a48ad7290d5be1f441940566468ad /drivers/net/usb
parent48679c6d772b1459a2945729e3a1256ac78fcabf (diff)
USB: rename usb_buffer_alloc() and usb_buffer_free() users
For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pedro Ribeiro <pedrib@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/ipheth.c24
-rw-r--r--drivers/net/usb/kaweth.c12
2 files changed, 16 insertions, 20 deletions
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 418825d26f90..197c352c47fb 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -128,17 +128,13 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
128 if (rx_urb == NULL) 128 if (rx_urb == NULL)
129 goto free_tx_urb; 129 goto free_tx_urb;
130 130
131 tx_buf = usb_buffer_alloc(iphone->udev, 131 tx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
132 IPHETH_BUF_SIZE, 132 GFP_KERNEL, &tx_urb->transfer_dma);
133 GFP_KERNEL,
134 &tx_urb->transfer_dma);
135 if (tx_buf == NULL) 133 if (tx_buf == NULL)
136 goto free_rx_urb; 134 goto free_rx_urb;
137 135
138 rx_buf = usb_buffer_alloc(iphone->udev, 136 rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
139 IPHETH_BUF_SIZE, 137 GFP_KERNEL, &rx_urb->transfer_dma);
140 GFP_KERNEL,
141 &rx_urb->transfer_dma);
142 if (rx_buf == NULL) 138 if (rx_buf == NULL)
143 goto free_tx_buf; 139 goto free_tx_buf;
144 140
@@ -150,8 +146,8 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
150 return 0; 146 return 0;
151 147
152free_tx_buf: 148free_tx_buf:
153 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf, 149 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
154 tx_urb->transfer_dma); 150 tx_urb->transfer_dma);
155free_rx_urb: 151free_rx_urb:
156 usb_free_urb(rx_urb); 152 usb_free_urb(rx_urb);
157free_tx_urb: 153free_tx_urb:
@@ -162,10 +158,10 @@ error_nomem:
162 158
163static void ipheth_free_urbs(struct ipheth_device *iphone) 159static void ipheth_free_urbs(struct ipheth_device *iphone)
164{ 160{
165 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, 161 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
166 iphone->rx_urb->transfer_dma); 162 iphone->rx_urb->transfer_dma);
167 usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, 163 usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
168 iphone->tx_urb->transfer_dma); 164 iphone->tx_urb->transfer_dma);
169 usb_free_urb(iphone->rx_urb); 165 usb_free_urb(iphone->rx_urb);
170 usb_free_urb(iphone->tx_urb); 166 usb_free_urb(iphone->tx_urb);
171} 167}
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index c4c334d9770f..a3eb7be51d53 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1156,13 +1156,13 @@ err_fw:
1156 if (!kaweth->irq_urb) 1156 if (!kaweth->irq_urb)
1157 goto err_tx_and_rx; 1157 goto err_tx_and_rx;
1158 1158
1159 kaweth->intbuffer = usb_buffer_alloc( kaweth->dev, 1159 kaweth->intbuffer = usb_alloc_coherent( kaweth->dev,
1160 INTBUFFERSIZE, 1160 INTBUFFERSIZE,
1161 GFP_KERNEL, 1161 GFP_KERNEL,
1162 &kaweth->intbufferhandle); 1162 &kaweth->intbufferhandle);
1163 if (!kaweth->intbuffer) 1163 if (!kaweth->intbuffer)
1164 goto err_tx_and_rx_and_irq; 1164 goto err_tx_and_rx_and_irq;
1165 kaweth->rx_buf = usb_buffer_alloc( kaweth->dev, 1165 kaweth->rx_buf = usb_alloc_coherent( kaweth->dev,
1166 KAWETH_BUF_SIZE, 1166 KAWETH_BUF_SIZE,
1167 GFP_KERNEL, 1167 GFP_KERNEL,
1168 &kaweth->rxbufferhandle); 1168 &kaweth->rxbufferhandle);
@@ -1203,9 +1203,9 @@ err_fw:
1203 1203
1204err_intfdata: 1204err_intfdata:
1205 usb_set_intfdata(intf, NULL); 1205 usb_set_intfdata(intf, NULL);
1206 usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); 1206 usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
1207err_all_but_rxbuf: 1207err_all_but_rxbuf:
1208 usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); 1208 usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
1209err_tx_and_rx_and_irq: 1209err_tx_and_rx_and_irq:
1210 usb_free_urb(kaweth->irq_urb); 1210 usb_free_urb(kaweth->irq_urb);
1211err_tx_and_rx: 1211err_tx_and_rx:
@@ -1242,8 +1242,8 @@ static void kaweth_disconnect(struct usb_interface *intf)
1242 usb_free_urb(kaweth->tx_urb); 1242 usb_free_urb(kaweth->tx_urb);
1243 usb_free_urb(kaweth->irq_urb); 1243 usb_free_urb(kaweth->irq_urb);
1244 1244
1245 usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); 1245 usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle);
1246 usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); 1246 usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle);
1247 1247
1248 free_netdev(netdev); 1248 free_netdev(netdev);
1249} 1249}