aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-13 14:21:12 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-13 14:21:12 -0400
commit34ad569fec46937b48cda329b037c1ff7fac9ab6 (patch)
treedd8a8858ed41694f8018ba523ad24ac69358aa5e /drivers/usb/atm
parent799ee9243d892ad959c8e5f4549593ece59f1c80 (diff)
USB: atm: usbatm: fix up debug printing code
If VERBOSE_DEBUG was enabled, lots of build errors happend (obviously no one uses this mode.) So fix that up, and get rid of the dbg() call, and use dev_dbg() like the rest of the driver does. Cc: Duncan Sands <duncan.sands@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r--drivers/usb/atm/usbatm.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index ee62b3576f94..35f10bfe15db 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -84,7 +84,7 @@
84#include <linux/ratelimit.h> 84#include <linux/ratelimit.h>
85 85
86#ifdef VERBOSE_DEBUG 86#ifdef VERBOSE_DEBUG
87static int usbatm_print_packet(const unsigned char *data, int len); 87static int usbatm_print_packet(struct usbatm_data *instance, const unsigned char *data, int len);
88#define PACKETDEBUG(arg...) usbatm_print_packet(arg) 88#define PACKETDEBUG(arg...) usbatm_print_packet(arg)
89#define vdbg(arg...) dev_dbg(arg) 89#define vdbg(arg...) dev_dbg(arg)
90#else 90#else
@@ -230,8 +230,8 @@ static int usbatm_submit_urb(struct urb *urb)
230 struct usbatm_channel *channel = urb->context; 230 struct usbatm_channel *channel = urb->context;
231 int ret; 231 int ret;
232 232
233 vdbg("%s: submitting urb 0x%p, size %u", 233 /* vdbg("%s: submitting urb 0x%p, size %u",
234 __func__, urb, urb->transfer_buffer_length); 234 __func__, urb, urb->transfer_buffer_length); */
235 235
236 ret = usb_submit_urb(urb, GFP_ATOMIC); 236 ret = usb_submit_urb(urb, GFP_ATOMIC);
237 if (ret) { 237 if (ret) {
@@ -261,8 +261,8 @@ static void usbatm_complete(struct urb *urb)
261 unsigned long flags; 261 unsigned long flags;
262 int status = urb->status; 262 int status = urb->status;
263 263
264 vdbg("%s: urb 0x%p, status %d, actual_length %d", 264 /* vdbg("%s: urb 0x%p, status %d, actual_length %d",
265 __func__, urb, status, urb->actual_length); 265 __func__, urb, status, urb->actual_length); */
266 266
267 /* usually in_interrupt(), but not always */ 267 /* usually in_interrupt(), but not always */
268 spin_lock_irqsave(&channel->lock, flags); 268 spin_lock_irqsave(&channel->lock, flags);
@@ -311,7 +311,7 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
311 int vci = ((source[1] & 0x0f) << 12) | (source[2] << 4) | (source[3] >> 4); 311 int vci = ((source[1] & 0x0f) << 12) | (source[2] << 4) | (source[3] >> 4);
312 u8 pti = ((source[3] & 0xe) >> 1); 312 u8 pti = ((source[3] & 0xe) >> 1);
313 313
314 vdbg("%s: vpi %hd, vci %d, pti %d", __func__, vpi, vci, pti); 314 vdbg(&instance->usb_intf->dev, "%s: vpi %hd, vci %d, pti %d", __func__, vpi, vci, pti);
315 315
316 if ((vci != instance->cached_vci) || (vpi != instance->cached_vpi)) { 316 if ((vci != instance->cached_vci) || (vpi != instance->cached_vpi)) {
317 instance->cached_vpi = vpi; 317 instance->cached_vpi = vpi;
@@ -381,7 +381,9 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
381 goto out; 381 goto out;
382 } 382 }
383 383
384 vdbg("%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", __func__, length, pdu_length, vcc); 384 vdbg(&instance->usb_intf->dev,
385 "%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)",
386 __func__, length, pdu_length, vcc);
385 387
386 if (!(skb = dev_alloc_skb(length))) { 388 if (!(skb = dev_alloc_skb(length))) {
387 if (printk_ratelimit()) 389 if (printk_ratelimit())
@@ -391,7 +393,9 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
391 goto out; 393 goto out;
392 } 394 }
393 395
394 vdbg("%s: allocated new sk_buff (skb: 0x%p, skb->truesize: %u)", __func__, skb, skb->truesize); 396 vdbg(&instance->usb_intf->dev,
397 "%s: allocated new sk_buff (skb: 0x%p, skb->truesize: %u)",
398 __func__, skb, skb->truesize);
395 399
396 if (!atm_charge(vcc, skb->truesize)) { 400 if (!atm_charge(vcc, skb->truesize)) {
397 atm_rldbg(instance, "%s: failed atm_charge (skb->truesize: %u)!\n", 401 atm_rldbg(instance, "%s: failed atm_charge (skb->truesize: %u)!\n",
@@ -405,10 +409,11 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char
405 length); 409 length);
406 __skb_put(skb, length); 410 __skb_put(skb, length);
407 411
408 vdbg("%s: sending skb 0x%p, skb->len %u, skb->truesize %u", 412 vdbg(&instance->usb_intf->dev,
413 "%s: sending skb 0x%p, skb->len %u, skb->truesize %u",
409 __func__, skb, skb->len, skb->truesize); 414 __func__, skb, skb->len, skb->truesize);
410 415
411 PACKETDEBUG(skb->data, skb->len); 416 PACKETDEBUG(instance, skb->data, skb->len);
412 417
413 vcc->push(vcc, skb); 418 vcc->push(vcc, skb);
414 419
@@ -474,7 +479,8 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance,
474 unsigned int bytes_written; 479 unsigned int bytes_written;
475 unsigned int stride = instance->tx_channel.stride; 480 unsigned int stride = instance->tx_channel.stride;
476 481
477 vdbg("%s: skb->len=%d, avail_space=%u", __func__, skb->len, avail_space); 482 vdbg(&instance->usb_intf->dev, "%s: skb->len=%d, avail_space=%u",
483 __func__, skb->len, avail_space);
478 UDSL_ASSERT(instance, !(avail_space % stride)); 484 UDSL_ASSERT(instance, !(avail_space % stride));
479 485
480 for (bytes_written = 0; bytes_written < avail_space && ctrl->len; 486 for (bytes_written = 0; bytes_written < avail_space && ctrl->len;
@@ -534,7 +540,8 @@ static void usbatm_rx_process(unsigned long data)
534 struct urb *urb; 540 struct urb *urb;
535 541
536 while ((urb = usbatm_pop_urb(&instance->rx_channel))) { 542 while ((urb = usbatm_pop_urb(&instance->rx_channel))) {
537 vdbg("%s: processing urb 0x%p", __func__, urb); 543 vdbg(&instance->usb_intf->dev,
544 "%s: processing urb 0x%p", __func__, urb);
538 545
539 if (usb_pipeisoc(urb->pipe)) { 546 if (usb_pipeisoc(urb->pipe)) {
540 unsigned char *merge_start = NULL; 547 unsigned char *merge_start = NULL;
@@ -608,7 +615,8 @@ static void usbatm_tx_process(unsigned long data)
608 buffer + bytes_written, 615 buffer + bytes_written,
609 buf_size - bytes_written); 616 buf_size - bytes_written);
610 617
611 vdbg("%s: wrote %u bytes from skb 0x%p to urb 0x%p", 618 vdbg(&instance->usb_intf->dev,
619 "%s: wrote %u bytes from skb 0x%p to urb 0x%p",
612 __func__, bytes_written, skb, urb); 620 __func__, bytes_written, skb, urb);
613 621
614 if (!UDSL_SKB(skb)->len) { 622 if (!UDSL_SKB(skb)->len) {
@@ -664,7 +672,8 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
664 struct usbatm_control *ctrl = UDSL_SKB(skb); 672 struct usbatm_control *ctrl = UDSL_SKB(skb);
665 int err; 673 int err;
666 674
667 vdbg("%s called (skb 0x%p, len %u)", __func__, skb, skb->len); 675 vdbg(&instance->usb_intf->dev, "%s called (skb 0x%p, len %u)", __func__,
676 skb, skb->len);
668 677
669 /* racy disconnection check - fine */ 678 /* racy disconnection check - fine */
670 if (!instance || instance->disconnected) { 679 if (!instance || instance->disconnected) {
@@ -688,7 +697,7 @@ static int usbatm_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
688 goto fail; 697 goto fail;
689 } 698 }
690 699
691 PACKETDEBUG(skb->data, skb->len); 700 PACKETDEBUG(instance, skb->data, skb->len);
692 701
693 /* initialize the control block */ 702 /* initialize the control block */
694 ctrl->atm.vcc = vcc; 703 ctrl->atm.vcc = vcc;
@@ -1202,7 +1211,7 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
1202 if (i >= num_rcv_urbs) 1211 if (i >= num_rcv_urbs)
1203 list_add_tail(&urb->urb_list, &channel->list); 1212 list_add_tail(&urb->urb_list, &channel->list);
1204 1213
1205 vdbg("%s: alloced buffer 0x%p buf size %u urb 0x%p", 1214 vdbg(&intf->dev, "%s: alloced buffer 0x%p buf size %u urb 0x%p",
1206 __func__, urb->transfer_buffer, urb->transfer_buffer_length, urb); 1215 __func__, urb->transfer_buffer, urb->transfer_buffer_length, urb);
1207 } 1216 }
1208 1217
@@ -1359,7 +1368,8 @@ MODULE_VERSION(DRIVER_VERSION);
1359************/ 1368************/
1360 1369
1361#ifdef VERBOSE_DEBUG 1370#ifdef VERBOSE_DEBUG
1362static int usbatm_print_packet(const unsigned char *data, int len) 1371static int usbatm_print_packet(struct usbatm_data *instance,
1372 const unsigned char *data, int len)
1363{ 1373{
1364 unsigned char buffer[256]; 1374 unsigned char buffer[256];
1365 int i = 0, j = 0; 1375 int i = 0, j = 0;
@@ -1369,7 +1379,7 @@ static int usbatm_print_packet(const unsigned char *data, int len)
1369 sprintf(buffer, "%.3d :", i); 1379 sprintf(buffer, "%.3d :", i);
1370 for (j = 0; (j < 16) && (i < len); j++, i++) 1380 for (j = 0; (j < 16) && (i < len); j++, i++)
1371 sprintf(buffer, "%s %2.2x", buffer, data[i]); 1381 sprintf(buffer, "%s %2.2x", buffer, data[i]);
1372 dbg("%s", buffer); 1382 dev_dbg(&instance->usb_intf->dev, "%s", buffer);
1373 } 1383 }
1374 return i; 1384 return i;
1375} 1385}