Commit 73e66ceada0b51279ffd4a6f5bffe79d7168d4e8

Authored by Greg Kroah-Hartman
1 parent c25e647836

USB: input: yealink.c: fix up dev_* messages

Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to.  So converted it to use that instead.

CC: Henk Vergonet <Henk.Vergonet@gmail.com>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 10 additions and 8 deletions Side-by-side Diff

drivers/input/misc/yealink.c
... ... @@ -101,6 +101,7 @@
101 101 struct yealink_dev {
102 102 struct input_dev *idev; /* input device */
103 103 struct usb_device *udev; /* usb device */
  104 + struct usb_interface *intf; /* usb interface */
104 105  
105 106 /* irq input channel */
106 107 struct yld_ctl_packet *irq_data;
... ... @@ -428,7 +429,7 @@
428 429 int ret, status = urb->status;
429 430  
430 431 if (status)
431   - dev_err(&yld->idev->dev, "%s - urb status %d\n",
  432 + dev_err(&yld->intf->dev, "%s - urb status %d\n",
432 433 __func__, status);
433 434  
434 435 switch (yld->irq_data->cmd) {
435 436  
... ... @@ -438,14 +439,14 @@
438 439 break;
439 440  
440 441 case CMD_SCANCODE:
441   - dev_dbg(&yld->idev->dev, "get scancode %x\n",
  442 + dev_dbg(&yld->intf->dev, "get scancode %x\n",
442 443 yld->irq_data->data[0]);
443 444  
444 445 report_key(yld, map_p1k_to_key(yld->irq_data->data[0]));
445 446 break;
446 447  
447 448 default:
448   - dev_err(&yld->idev->dev, "unexpected response %x\n",
  449 + dev_err(&yld->intf->dev, "unexpected response %x\n",
449 450 yld->irq_data->cmd);
450 451 }
451 452  
... ... @@ -454,7 +455,7 @@
454 455 if (!yld->shutdown) {
455 456 ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
456 457 if (ret && ret != -EPERM)
457   - dev_err(&yld->idev->dev,
  458 + dev_err(&yld->intf->dev,
458 459 "%s - usb_submit_urb failed %d\n",
459 460 __func__, ret);
460 461 }
... ... @@ -466,7 +467,7 @@
466 467 int ret = 0, status = urb->status;
467 468  
468 469 if (status)
469   - dev_err(&yld->idev->dev, "%s - urb status %d\n",
  470 + dev_err(&yld->intf->dev, "%s - urb status %d\n",
470 471 __func__, status);
471 472  
472 473 switch (yld->ctl_data->cmd) {
... ... @@ -485,7 +486,7 @@
485 486 }
486 487  
487 488 if (ret && ret != -EPERM)
488   - dev_err(&yld->idev->dev, "%s - usb_submit_urb failed %d\n",
  489 + dev_err(&yld->intf->dev, "%s - usb_submit_urb failed %d\n",
489 490 __func__, ret);
490 491 }
491 492  
... ... @@ -518,7 +519,7 @@
518 519 struct yealink_dev *yld = input_get_drvdata(dev);
519 520 int i, ret;
520 521  
521   - dev_dbg(&yld->idev->dev, "%s\n", __func__);
  522 + dev_dbg(&yld->intf->dev, "%s\n", __func__);
522 523  
523 524 /* force updates to device */
524 525 for (i = 0; i<sizeof(yld->master); i++)
... ... @@ -533,7 +534,7 @@
533 534 yld->ctl_data->size = 10;
534 535 yld->ctl_data->sum = 0x100-CMD_INIT-10;
535 536 if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) {
536   - dev_dbg(&yld->idev->dev,
  537 + dev_dbg(&yld->intf->dev,
537 538 "%s - usb_submit_urb failed with result %d\n",
538 539 __func__, ret);
539 540 return ret;
... ... @@ -884,6 +885,7 @@
884 885 return -ENOMEM;
885 886  
886 887 yld->udev = udev;
  888 + yld->intf = intf;
887 889  
888 890 yld->idev = input_dev = input_allocate_device();
889 891 if (!input_dev)