aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-04 18:33:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-04 18:33:01 -0400
commit73e66ceada0b51279ffd4a6f5bffe79d7168d4e8 (patch)
tree88e539be3168339922dc8cfd611b069e40385b12 /drivers/input/misc
parentc25e647836cd53f2da7ceff6fabf2603b4362212 (diff)
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>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/yealink.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c
index 37b126c06fc1..285a5bd6cbc9 100644
--- a/drivers/input/misc/yealink.c
+++ b/drivers/input/misc/yealink.c
@@ -101,6 +101,7 @@ static const struct lcd_segment_map {
101struct yealink_dev { 101struct 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,7 @@ 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 dev_err(&yld->idev->dev, "%s - urb status %d\n", 432 dev_err(&yld->intf->dev, "%s - urb status %d\n",
432 __func__, status); 433 __func__, status);
433 434
434 switch (yld->irq_data->cmd) { 435 switch (yld->irq_data->cmd) {
@@ -438,14 +439,14 @@ static void urb_irq_callback(struct urb *urb)
438 break; 439 break;
439 440
440 case CMD_SCANCODE: 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 yld->irq_data->data[0]); 443 yld->irq_data->data[0]);
443 444
444 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]));
445 break; 446 break;
446 447
447 default: 448 default:
448 dev_err(&yld->idev->dev, "unexpected response %x\n", 449 dev_err(&yld->intf->dev, "unexpected response %x\n",
449 yld->irq_data->cmd); 450 yld->irq_data->cmd);
450 } 451 }
451 452
@@ -454,7 +455,7 @@ static void urb_irq_callback(struct urb *urb)
454 if (!yld->shutdown) { 455 if (!yld->shutdown) {
455 ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC); 456 ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
456 if (ret && ret != -EPERM) 457 if (ret && ret != -EPERM)
457 dev_err(&yld->idev->dev, 458 dev_err(&yld->intf->dev,
458 "%s - usb_submit_urb failed %d\n", 459 "%s - usb_submit_urb failed %d\n",
459 __func__, ret); 460 __func__, ret);
460 } 461 }
@@ -466,7 +467,7 @@ static void urb_ctl_callback(struct urb *urb)
466 int ret = 0, status = urb->status; 467 int ret = 0, status = urb->status;
467 468
468 if (status) 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 __func__, status); 471 __func__, status);
471 472
472 switch (yld->ctl_data->cmd) { 473 switch (yld->ctl_data->cmd) {
@@ -485,7 +486,7 @@ static void urb_ctl_callback(struct urb *urb)
485 } 486 }
486 487
487 if (ret && ret != -EPERM) 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 __func__, ret); 490 __func__, ret);
490} 491}
491 492
@@ -518,7 +519,7 @@ static int input_open(struct input_dev *dev)
518 struct yealink_dev *yld = input_get_drvdata(dev); 519 struct yealink_dev *yld = input_get_drvdata(dev);
519 int i, ret; 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 /* force updates to device */ 524 /* force updates to device */
524 for (i = 0; i<sizeof(yld->master); i++) 525 for (i = 0; i<sizeof(yld->master); i++)
@@ -533,7 +534,7 @@ static int input_open(struct input_dev *dev)
533 yld->ctl_data->size = 10; 534 yld->ctl_data->size = 10;
534 yld->ctl_data->sum = 0x100-CMD_INIT-10; 535 yld->ctl_data->sum = 0x100-CMD_INIT-10;
535 if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) { 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 "%s - usb_submit_urb failed with result %d\n", 538 "%s - usb_submit_urb failed with result %d\n",
538 __func__, ret); 539 __func__, ret);
539 return ret; 540 return ret;
@@ -884,6 +885,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
884 return -ENOMEM; 885 return -ENOMEM;
885 886
886 yld->udev = udev; 887 yld->udev = udev;
888 yld->intf = intf;
887 889
888 yld->idev = input_dev = input_allocate_device(); 890 yld->idev = input_dev = input_allocate_device();
889 if (!input_dev) 891 if (!input_dev)