diff options
| author | Johan Hovold <jhovold@gmail.com> | 2011-03-22 06:12:15 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-13 19:18:28 -0400 |
| commit | a5cc7ef92f69a88a1984cc3e09f6c19656efeb2e (patch) | |
| tree | 5c617b2012c7431061926b1f3620c284a52f5daf /drivers/usb | |
| parent | 1d9846e505febb71255b098910ace741433312b7 (diff) | |
USB: cdc-acm: replace dbg macros with dev_dbg
Replace all remaining instances of dbg with dev_dbg.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 80 |
1 files changed, 52 insertions, 28 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 612b9ff0fcf2..fee7d8b94fe2 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -111,8 +111,9 @@ static int acm_ctrl_msg(struct acm *acm, int request, int value, | |||
| 111 | request, USB_RT_ACM, value, | 111 | request, USB_RT_ACM, value, |
| 112 | acm->control->altsetting[0].desc.bInterfaceNumber, | 112 | acm->control->altsetting[0].desc.bInterfaceNumber, |
| 113 | buf, len, 5000); | 113 | buf, len, 5000); |
| 114 | dbg("acm_control_msg: rq: 0x%02x val: %#x len: %#x result: %d", | 114 | dev_dbg(&acm->control->dev, |
| 115 | request, value, len, retval); | 115 | "%s - rq 0x%02x, val %#x, len %#x, result %d\n", |
| 116 | __func__, request, value, len, retval); | ||
| 116 | return retval < 0 ? retval : 0; | 117 | return retval < 0 ? retval : 0; |
| 117 | } | 118 | } |
| 118 | 119 | ||
| @@ -192,7 +193,9 @@ static int acm_start_wb(struct acm *acm, struct acm_wb *wb) | |||
| 192 | 193 | ||
| 193 | rc = usb_submit_urb(wb->urb, GFP_ATOMIC); | 194 | rc = usb_submit_urb(wb->urb, GFP_ATOMIC); |
| 194 | if (rc < 0) { | 195 | if (rc < 0) { |
| 195 | dbg("usb_submit_urb(write bulk) failed: %d", rc); | 196 | dev_err(&acm->data->dev, |
| 197 | "%s - usb_submit_urb(write bulk) failed: %d\n", | ||
| 198 | __func__, rc); | ||
| 196 | acm_write_done(acm, wb); | 199 | acm_write_done(acm, wb); |
| 197 | } | 200 | } |
| 198 | return rc; | 201 | return rc; |
| @@ -211,7 +214,8 @@ static int acm_write_start(struct acm *acm, int wbn) | |||
| 211 | return -ENODEV; | 214 | return -ENODEV; |
| 212 | } | 215 | } |
| 213 | 216 | ||
| 214 | dbg("%s susp_count: %d", __func__, acm->susp_count); | 217 | dev_dbg(&acm->data->dev, "%s - susp_count %d\n", __func__, |
| 218 | acm->susp_count); | ||
| 215 | usb_autopm_get_interface_async(acm->control); | 219 | usb_autopm_get_interface_async(acm->control); |
| 216 | if (acm->susp_count) { | 220 | if (acm->susp_count) { |
| 217 | if (!acm->delayed_wb) | 221 | if (!acm->delayed_wb) |
| @@ -287,10 +291,14 @@ static void acm_ctrl_irq(struct urb *urb) | |||
| 287 | case -ENOENT: | 291 | case -ENOENT: |
| 288 | case -ESHUTDOWN: | 292 | case -ESHUTDOWN: |
| 289 | /* this urb is terminated, clean up */ | 293 | /* this urb is terminated, clean up */ |
| 290 | dbg("%s - urb shutting down with status: %d", __func__, status); | 294 | dev_dbg(&acm->control->dev, |
| 295 | "%s - urb shutting down with status: %d\n", | ||
| 296 | __func__, status); | ||
| 291 | return; | 297 | return; |
| 292 | default: | 298 | default: |
| 293 | dbg("%s - nonzero urb status received: %d", __func__, status); | 299 | dev_dbg(&acm->control->dev, |
| 300 | "%s - nonzero urb status received: %d\n", | ||
| 301 | __func__, status); | ||
| 294 | goto exit; | 302 | goto exit; |
| 295 | } | 303 | } |
| 296 | 304 | ||
| @@ -302,8 +310,8 @@ static void acm_ctrl_irq(struct urb *urb) | |||
| 302 | data = (unsigned char *)(dr + 1); | 310 | data = (unsigned char *)(dr + 1); |
| 303 | switch (dr->bNotificationType) { | 311 | switch (dr->bNotificationType) { |
| 304 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: | 312 | case USB_CDC_NOTIFY_NETWORK_CONNECTION: |
| 305 | dbg("%s network", dr->wValue ? | 313 | dev_dbg(&acm->control->dev, "%s - network connection: %d\n", |
| 306 | "connected to" : "disconnected from"); | 314 | __func__, dr->wValue); |
| 307 | break; | 315 | break; |
| 308 | 316 | ||
| 309 | case USB_CDC_NOTIFY_SERIAL_STATE: | 317 | case USB_CDC_NOTIFY_SERIAL_STATE: |
| @@ -313,7 +321,8 @@ static void acm_ctrl_irq(struct urb *urb) | |||
| 313 | if (tty) { | 321 | if (tty) { |
| 314 | if (!acm->clocal && | 322 | if (!acm->clocal && |
| 315 | (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) { | 323 | (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) { |
| 316 | dbg("calling hangup"); | 324 | dev_dbg(&acm->control->dev, |
| 325 | "%s - calling hangup\n", __func__); | ||
| 317 | tty_hangup(tty); | 326 | tty_hangup(tty); |
| 318 | } | 327 | } |
| 319 | tty_kref_put(tty); | 328 | tty_kref_put(tty); |
| @@ -321,7 +330,10 @@ static void acm_ctrl_irq(struct urb *urb) | |||
| 321 | 330 | ||
| 322 | acm->ctrlin = newctrl; | 331 | acm->ctrlin = newctrl; |
| 323 | 332 | ||
| 324 | dbg("input control lines: dcd%c dsr%c break%c ring%c framing%c parity%c overrun%c", | 333 | dev_dbg(&acm->control->dev, |
| 334 | "%s - input control lines: dcd%c dsr%c break%c " | ||
| 335 | "ring%c framing%c parity%c overrun%c\n", | ||
| 336 | __func__, | ||
| 325 | acm->ctrlin & ACM_CTRL_DCD ? '+' : '-', | 337 | acm->ctrlin & ACM_CTRL_DCD ? '+' : '-', |
| 326 | acm->ctrlin & ACM_CTRL_DSR ? '+' : '-', | 338 | acm->ctrlin & ACM_CTRL_DSR ? '+' : '-', |
| 327 | acm->ctrlin & ACM_CTRL_BRK ? '+' : '-', | 339 | acm->ctrlin & ACM_CTRL_BRK ? '+' : '-', |
| @@ -332,7 +344,10 @@ static void acm_ctrl_irq(struct urb *urb) | |||
| 332 | break; | 344 | break; |
| 333 | 345 | ||
| 334 | default: | 346 | default: |
| 335 | dbg("unknown notification %d received: index %d len %d data0 %d data1 %d", | 347 | dev_dbg(&acm->control->dev, |
| 348 | "%s - unknown notification %d received: index %d " | ||
| 349 | "len %d data0 %d data1 %d\n", | ||
| 350 | __func__, | ||
| 336 | dr->bNotificationType, dr->wIndex, | 351 | dr->bNotificationType, dr->wIndex, |
| 337 | dr->wLength, data[0], data[1]); | 352 | dr->wLength, data[0], data[1]); |
| 338 | break; | 353 | break; |
| @@ -352,7 +367,7 @@ static void acm_read_bulk(struct urb *urb) | |||
| 352 | struct acm *acm = rcv->instance; | 367 | struct acm *acm = rcv->instance; |
| 353 | int status = urb->status; | 368 | int status = urb->status; |
| 354 | 369 | ||
| 355 | dbg("Entering acm_read_bulk with status %d", status); | 370 | dev_dbg(&acm->data->dev, "%s - status %d\n", __func__, status); |
| 356 | 371 | ||
| 357 | if (!ACM_READY(acm)) { | 372 | if (!ACM_READY(acm)) { |
| 358 | dev_dbg(&acm->data->dev, "%s - acm not ready\n", __func__); | 373 | dev_dbg(&acm->data->dev, "%s - acm not ready\n", __func__); |
| @@ -395,10 +410,10 @@ static void acm_rx_tasklet(unsigned long _acm) | |||
| 395 | unsigned long flags; | 410 | unsigned long flags; |
| 396 | unsigned char throttled; | 411 | unsigned char throttled; |
| 397 | 412 | ||
| 398 | dbg("Entering acm_rx_tasklet"); | 413 | dev_dbg(&acm->data->dev, "%s\n", __func__); |
| 399 | 414 | ||
| 400 | if (!ACM_READY(acm)) { | 415 | if (!ACM_READY(acm)) { |
| 401 | dbg("acm_rx_tasklet: ACM not ready"); | 416 | dev_dbg(&acm->data->dev, "%s - acm not ready\n", __func__); |
| 402 | return; | 417 | return; |
| 403 | } | 418 | } |
| 404 | 419 | ||
| @@ -406,7 +421,7 @@ static void acm_rx_tasklet(unsigned long _acm) | |||
| 406 | throttled = acm->throttle; | 421 | throttled = acm->throttle; |
| 407 | spin_unlock_irqrestore(&acm->throttle_lock, flags); | 422 | spin_unlock_irqrestore(&acm->throttle_lock, flags); |
| 408 | if (throttled) { | 423 | if (throttled) { |
| 409 | dbg("acm_rx_tasklet: throttled"); | 424 | dev_dbg(&acm->data->dev, "%s - throttled\n", __func__); |
| 410 | return; | 425 | return; |
| 411 | } | 426 | } |
| 412 | 427 | ||
| @@ -423,8 +438,8 @@ next_buffer: | |||
| 423 | list_del(&buf->list); | 438 | list_del(&buf->list); |
| 424 | spin_unlock_irqrestore(&acm->read_lock, flags); | 439 | spin_unlock_irqrestore(&acm->read_lock, flags); |
| 425 | 440 | ||
| 426 | dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size); | 441 | dev_dbg(&acm->data->dev, "%s - processing buf 0x%p, size = %d\n", |
| 427 | 442 | __func__, buf, buf->size); | |
| 428 | if (tty) { | 443 | if (tty) { |
| 429 | spin_lock_irqsave(&acm->throttle_lock, flags); | 444 | spin_lock_irqsave(&acm->throttle_lock, flags); |
| 430 | throttled = acm->throttle; | 445 | throttled = acm->throttle; |
| @@ -434,7 +449,8 @@ next_buffer: | |||
| 434 | tty_flip_buffer_push(tty); | 449 | tty_flip_buffer_push(tty); |
| 435 | } else { | 450 | } else { |
| 436 | tty_kref_put(tty); | 451 | tty_kref_put(tty); |
| 437 | dbg("Throttling noticed"); | 452 | dev_dbg(&acm->data->dev, "%s - throttling noticed\n", |
| 453 | __func__); | ||
| 438 | spin_lock_irqsave(&acm->read_lock, flags); | 454 | spin_lock_irqsave(&acm->read_lock, flags); |
| 439 | list_add(&buf->list, &acm->filled_read_bufs); | 455 | list_add(&buf->list, &acm->filled_read_bufs); |
| 440 | spin_unlock_irqrestore(&acm->read_lock, flags); | 456 | spin_unlock_irqrestore(&acm->read_lock, flags); |
| @@ -495,7 +511,9 @@ urbs: | |||
| 495 | return; | 511 | return; |
| 496 | } else { | 512 | } else { |
| 497 | spin_unlock_irqrestore(&acm->read_lock, flags); | 513 | spin_unlock_irqrestore(&acm->read_lock, flags); |
| 498 | dbg("acm_rx_tasklet: sending urb 0x%p, rcv 0x%p, buf 0x%p", rcv->urb, rcv, buf); | 514 | dev_dbg(&acm->data->dev, |
| 515 | "%s - sending urb 0x%p, rcv 0x%p, buf 0x%p\n", | ||
| 516 | __func__, rcv->urb, rcv, buf); | ||
| 499 | } | 517 | } |
| 500 | } | 518 | } |
| 501 | spin_lock_irqsave(&acm->read_lock, flags); | 519 | spin_lock_irqsave(&acm->read_lock, flags); |
| @@ -552,7 +570,6 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) | |||
| 552 | struct acm *acm; | 570 | struct acm *acm; |
| 553 | int rv = -ENODEV; | 571 | int rv = -ENODEV; |
| 554 | int i; | 572 | int i; |
| 555 | dbg("Entering acm_tty_open."); | ||
| 556 | 573 | ||
| 557 | mutex_lock(&open_mutex); | 574 | mutex_lock(&open_mutex); |
| 558 | 575 | ||
| @@ -562,6 +579,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) | |||
| 562 | else | 579 | else |
| 563 | rv = 0; | 580 | rv = 0; |
| 564 | 581 | ||
| 582 | dev_dbg(&acm->control->dev, "%s\n", __func__); | ||
| 583 | |||
| 565 | set_bit(TTY_NO_WRITE_SPLIT, &tty->flags); | 584 | set_bit(TTY_NO_WRITE_SPLIT, &tty->flags); |
| 566 | 585 | ||
| 567 | tty->driver_data = acm; | 586 | tty->driver_data = acm; |
| @@ -581,7 +600,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) | |||
| 581 | 600 | ||
| 582 | acm->ctrlurb->dev = acm->dev; | 601 | acm->ctrlurb->dev = acm->dev; |
| 583 | if (usb_submit_urb(acm->ctrlurb, GFP_KERNEL)) { | 602 | if (usb_submit_urb(acm->ctrlurb, GFP_KERNEL)) { |
| 584 | dbg("usb_submit_urb(ctrl irq) failed"); | 603 | dev_err(&acm->control->dev, |
| 604 | "%s - usb_submit_urb(ctrl irq) failed\n", __func__); | ||
| 585 | goto bail_out; | 605 | goto bail_out; |
| 586 | } | 606 | } |
| 587 | 607 | ||
| @@ -701,13 +721,13 @@ static int acm_tty_write(struct tty_struct *tty, | |||
| 701 | int wbn; | 721 | int wbn; |
| 702 | struct acm_wb *wb; | 722 | struct acm_wb *wb; |
| 703 | 723 | ||
| 704 | dbg("Entering acm_tty_write to write %d bytes,", count); | ||
| 705 | |||
| 706 | if (!ACM_READY(acm)) | 724 | if (!ACM_READY(acm)) |
| 707 | return -EINVAL; | 725 | return -EINVAL; |
| 708 | if (!count) | 726 | if (!count) |
| 709 | return 0; | 727 | return 0; |
| 710 | 728 | ||
| 729 | dev_dbg(&acm->data->dev, "%s - count %d\n", __func__, count); | ||
| 730 | |||
| 711 | spin_lock_irqsave(&acm->write_lock, flags); | 731 | spin_lock_irqsave(&acm->write_lock, flags); |
| 712 | wbn = acm_wb_alloc(acm); | 732 | wbn = acm_wb_alloc(acm); |
| 713 | if (wbn < 0) { | 733 | if (wbn < 0) { |
| @@ -717,7 +737,7 @@ static int acm_tty_write(struct tty_struct *tty, | |||
| 717 | wb = &acm->wb[wbn]; | 737 | wb = &acm->wb[wbn]; |
| 718 | 738 | ||
| 719 | count = (count > acm->writesize) ? acm->writesize : count; | 739 | count = (count > acm->writesize) ? acm->writesize : count; |
| 720 | dbg("Get %d bytes...", count); | 740 | dev_dbg(&acm->data->dev, "%s - write %d\n", __func__, count); |
| 721 | memcpy(wb->buf, buf, count); | 741 | memcpy(wb->buf, buf, count); |
| 722 | wb->len = count; | 742 | wb->len = count; |
| 723 | spin_unlock_irqrestore(&acm->write_lock, flags); | 743 | spin_unlock_irqrestore(&acm->write_lock, flags); |
| @@ -780,7 +800,8 @@ static int acm_tty_break_ctl(struct tty_struct *tty, int state) | |||
| 780 | return -EINVAL; | 800 | return -EINVAL; |
| 781 | retval = acm_send_break(acm, state ? 0xffff : 0); | 801 | retval = acm_send_break(acm, state ? 0xffff : 0); |
| 782 | if (retval < 0) | 802 | if (retval < 0) |
| 783 | dbg("send break failed"); | 803 | dev_dbg(&acm->control->dev, "%s - send break failed\n", |
| 804 | __func__); | ||
| 784 | return retval; | 805 | return retval; |
| 785 | } | 806 | } |
| 786 | 807 | ||
| @@ -875,7 +896,9 @@ static void acm_tty_set_termios(struct tty_struct *tty, | |||
| 875 | 896 | ||
| 876 | if (memcmp(&acm->line, &newline, sizeof newline)) { | 897 | if (memcmp(&acm->line, &newline, sizeof newline)) { |
| 877 | memcpy(&acm->line, &newline, sizeof newline); | 898 | memcpy(&acm->line, &newline, sizeof newline); |
| 878 | dbg("set line: %d %d %d %d", le32_to_cpu(newline.dwDTERate), | 899 | dev_dbg(&acm->control->dev, "%s - set line: %d %d %d %d\n", |
| 900 | __func__, | ||
| 901 | le32_to_cpu(newline.dwDTERate), | ||
| 879 | newline.bCharFormat, newline.bParityType, | 902 | newline.bCharFormat, newline.bParityType, |
| 880 | newline.bDataBits); | 903 | newline.bDataBits); |
| 881 | acm_set_line(acm, &acm->line); | 904 | acm_set_line(acm, &acm->line); |
| @@ -1136,7 +1159,7 @@ skip_normal_probe: | |||
| 1136 | epwrite = t; | 1159 | epwrite = t; |
| 1137 | } | 1160 | } |
| 1138 | made_compressed_probe: | 1161 | made_compressed_probe: |
| 1139 | dbg("interfaces are valid"); | 1162 | dev_dbg(&intf->dev, "interfaces are valid\n"); |
| 1140 | for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); | 1163 | for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); |
| 1141 | 1164 | ||
| 1142 | if (minor == ACM_TTY_MINORS) { | 1165 | if (minor == ACM_TTY_MINORS) { |
| @@ -1321,7 +1344,8 @@ alloc_fail: | |||
| 1321 | static void stop_data_traffic(struct acm *acm) | 1344 | static void stop_data_traffic(struct acm *acm) |
| 1322 | { | 1345 | { |
| 1323 | int i; | 1346 | int i; |
| 1324 | dbg("Entering stop_data_traffic"); | 1347 | |
| 1348 | dev_dbg(&acm->control->dev, "%s\n", __func__); | ||
| 1325 | 1349 | ||
| 1326 | tasklet_disable(&acm->urb_task); | 1350 | tasklet_disable(&acm->urb_task); |
| 1327 | 1351 | ||
