diff options
Diffstat (limited to 'drivers/input/misc/yealink.c')
-rw-r--r-- | drivers/input/misc/yealink.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index f4776e7f8c15..285a5bd6cbc9 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c | |||
@@ -101,6 +101,7 @@ static const struct lcd_segment_map { | |||
101 | struct yealink_dev { | 101 | struct yealink_dev { |
102 | struct input_dev *idev; /* input device */ | 102 | struct input_dev *idev; /* input device */ |
103 | struct usb_device *udev; /* usb device */ | 103 | struct usb_device *udev; /* usb device */ |
104 | struct usb_interface *intf; /* usb interface */ | ||
104 | 105 | ||
105 | /* irq input channel */ | 106 | /* irq input channel */ |
106 | struct yld_ctl_packet *irq_data; | 107 | struct yld_ctl_packet *irq_data; |
@@ -428,7 +429,8 @@ static void urb_irq_callback(struct urb *urb) | |||
428 | int ret, status = urb->status; | 429 | int ret, status = urb->status; |
429 | 430 | ||
430 | if (status) | 431 | if (status) |
431 | err("%s - urb status %d", __func__, status); | 432 | dev_err(&yld->intf->dev, "%s - urb status %d\n", |
433 | __func__, status); | ||
432 | 434 | ||
433 | switch (yld->irq_data->cmd) { | 435 | switch (yld->irq_data->cmd) { |
434 | case CMD_KEYPRESS: | 436 | case CMD_KEYPRESS: |
@@ -437,13 +439,15 @@ static void urb_irq_callback(struct urb *urb) | |||
437 | break; | 439 | break; |
438 | 440 | ||
439 | case CMD_SCANCODE: | 441 | case CMD_SCANCODE: |
440 | dbg("get scancode %x", yld->irq_data->data[0]); | 442 | dev_dbg(&yld->intf->dev, "get scancode %x\n", |
443 | yld->irq_data->data[0]); | ||
441 | 444 | ||
442 | report_key(yld, map_p1k_to_key(yld->irq_data->data[0])); | 445 | report_key(yld, map_p1k_to_key(yld->irq_data->data[0])); |
443 | break; | 446 | break; |
444 | 447 | ||
445 | default: | 448 | default: |
446 | err("unexpected response %x", yld->irq_data->cmd); | 449 | dev_err(&yld->intf->dev, "unexpected response %x\n", |
450 | yld->irq_data->cmd); | ||
447 | } | 451 | } |
448 | 452 | ||
449 | yealink_do_idle_tasks(yld); | 453 | yealink_do_idle_tasks(yld); |
@@ -451,7 +455,9 @@ static void urb_irq_callback(struct urb *urb) | |||
451 | if (!yld->shutdown) { | 455 | if (!yld->shutdown) { |
452 | ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC); | 456 | ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC); |
453 | if (ret && ret != -EPERM) | 457 | if (ret && ret != -EPERM) |
454 | err("%s - usb_submit_urb failed %d", __func__, ret); | 458 | dev_err(&yld->intf->dev, |
459 | "%s - usb_submit_urb failed %d\n", | ||
460 | __func__, ret); | ||
455 | } | 461 | } |
456 | } | 462 | } |
457 | 463 | ||
@@ -461,7 +467,8 @@ static void urb_ctl_callback(struct urb *urb) | |||
461 | int ret = 0, status = urb->status; | 467 | int ret = 0, status = urb->status; |
462 | 468 | ||
463 | if (status) | 469 | if (status) |
464 | err("%s - urb status %d", __func__, status); | 470 | dev_err(&yld->intf->dev, "%s - urb status %d\n", |
471 | __func__, status); | ||
465 | 472 | ||
466 | switch (yld->ctl_data->cmd) { | 473 | switch (yld->ctl_data->cmd) { |
467 | case CMD_KEYPRESS: | 474 | case CMD_KEYPRESS: |
@@ -479,7 +486,8 @@ static void urb_ctl_callback(struct urb *urb) | |||
479 | } | 486 | } |
480 | 487 | ||
481 | if (ret && ret != -EPERM) | 488 | if (ret && ret != -EPERM) |
482 | err("%s - usb_submit_urb failed %d", __func__, ret); | 489 | dev_err(&yld->intf->dev, "%s - usb_submit_urb failed %d\n", |
490 | __func__, ret); | ||
483 | } | 491 | } |
484 | 492 | ||
485 | /******************************************************************************* | 493 | /******************************************************************************* |
@@ -511,7 +519,7 @@ static int input_open(struct input_dev *dev) | |||
511 | struct yealink_dev *yld = input_get_drvdata(dev); | 519 | struct yealink_dev *yld = input_get_drvdata(dev); |
512 | int i, ret; | 520 | int i, ret; |
513 | 521 | ||
514 | dbg("%s", __func__); | 522 | dev_dbg(&yld->intf->dev, "%s\n", __func__); |
515 | 523 | ||
516 | /* force updates to device */ | 524 | /* force updates to device */ |
517 | for (i = 0; i<sizeof(yld->master); i++) | 525 | for (i = 0; i<sizeof(yld->master); i++) |
@@ -526,8 +534,9 @@ static int input_open(struct input_dev *dev) | |||
526 | yld->ctl_data->size = 10; | 534 | yld->ctl_data->size = 10; |
527 | yld->ctl_data->sum = 0x100-CMD_INIT-10; | 535 | yld->ctl_data->sum = 0x100-CMD_INIT-10; |
528 | if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) { | 536 | if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) { |
529 | dbg("%s - usb_submit_urb failed with result %d", | 537 | dev_dbg(&yld->intf->dev, |
530 | __func__, ret); | 538 | "%s - usb_submit_urb failed with result %d\n", |
539 | __func__, ret); | ||
531 | return ret; | 540 | return ret; |
532 | } | 541 | } |
533 | return 0; | 542 | return 0; |
@@ -876,6 +885,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
876 | return -ENOMEM; | 885 | return -ENOMEM; |
877 | 886 | ||
878 | yld->udev = udev; | 887 | yld->udev = udev; |
888 | yld->intf = intf; | ||
879 | 889 | ||
880 | yld->idev = input_dev = input_allocate_device(); | 890 | yld->idev = input_dev = input_allocate_device(); |
881 | if (!input_dev) | 891 | if (!input_dev) |
@@ -909,7 +919,8 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
909 | pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); | 919 | pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); |
910 | ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); | 920 | ret = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); |
911 | if (ret != USB_PKT_LEN) | 921 | if (ret != USB_PKT_LEN) |
912 | err("invalid payload size %d, expected %zd", ret, USB_PKT_LEN); | 922 | dev_err(&intf->dev, "invalid payload size %d, expected %zd\n", |
923 | ret, USB_PKT_LEN); | ||
913 | 924 | ||
914 | /* initialise irq urb */ | 925 | /* initialise irq urb */ |
915 | usb_fill_int_urb(yld->urb_irq, udev, pipe, yld->irq_data, | 926 | usb_fill_int_urb(yld->urb_irq, udev, pipe, yld->irq_data, |