Commit 73e66cea authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c25e6478
...@@ -101,6 +101,7 @@ static const struct lcd_segment_map { ...@@ -101,6 +101,7 @@ static const struct lcd_segment_map {
struct yealink_dev { struct yealink_dev {
struct input_dev *idev; /* input device */ struct input_dev *idev; /* input device */
struct usb_device *udev; /* usb device */ struct usb_device *udev; /* usb device */
struct usb_interface *intf; /* usb interface */
/* irq input channel */ /* irq input channel */
struct yld_ctl_packet *irq_data; struct yld_ctl_packet *irq_data;
...@@ -428,7 +429,7 @@ static void urb_irq_callback(struct urb *urb) ...@@ -428,7 +429,7 @@ static void urb_irq_callback(struct urb *urb)
int ret, status = urb->status; int ret, status = urb->status;
if (status) if (status)
dev_err(&yld->idev->dev, "%s - urb status %d\n", dev_err(&yld->intf->dev, "%s - urb status %d\n",
__func__, status); __func__, status);
switch (yld->irq_data->cmd) { switch (yld->irq_data->cmd) {
...@@ -438,14 +439,14 @@ static void urb_irq_callback(struct urb *urb) ...@@ -438,14 +439,14 @@ static void urb_irq_callback(struct urb *urb)
break; break;
case CMD_SCANCODE: case CMD_SCANCODE:
dev_dbg(&yld->idev->dev, "get scancode %x\n", dev_dbg(&yld->intf->dev, "get scancode %x\n",
yld->irq_data->data[0]); yld->irq_data->data[0]);
report_key(yld, map_p1k_to_key(yld->irq_data->data[0])); report_key(yld, map_p1k_to_key(yld->irq_data->data[0]));
break; break;
default: default:
dev_err(&yld->idev->dev, "unexpected response %x\n", dev_err(&yld->intf->dev, "unexpected response %x\n",
yld->irq_data->cmd); yld->irq_data->cmd);
} }
...@@ -454,7 +455,7 @@ static void urb_irq_callback(struct urb *urb) ...@@ -454,7 +455,7 @@ static void urb_irq_callback(struct urb *urb)
if (!yld->shutdown) { if (!yld->shutdown) {
ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC); ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
if (ret && ret != -EPERM) if (ret && ret != -EPERM)
dev_err(&yld->idev->dev, dev_err(&yld->intf->dev,
"%s - usb_submit_urb failed %d\n", "%s - usb_submit_urb failed %d\n",
__func__, ret); __func__, ret);
} }
...@@ -466,7 +467,7 @@ static void urb_ctl_callback(struct urb *urb) ...@@ -466,7 +467,7 @@ static void urb_ctl_callback(struct urb *urb)
int ret = 0, status = urb->status; int ret = 0, status = urb->status;
if (status) if (status)
dev_err(&yld->idev->dev, "%s - urb status %d\n", dev_err(&yld->intf->dev, "%s - urb status %d\n",
__func__, status); __func__, status);
switch (yld->ctl_data->cmd) { switch (yld->ctl_data->cmd) {
...@@ -485,7 +486,7 @@ static void urb_ctl_callback(struct urb *urb) ...@@ -485,7 +486,7 @@ static void urb_ctl_callback(struct urb *urb)
} }
if (ret && ret != -EPERM) if (ret && ret != -EPERM)
dev_err(&yld->idev->dev, "%s - usb_submit_urb failed %d\n", dev_err(&yld->intf->dev, "%s - usb_submit_urb failed %d\n",
__func__, ret); __func__, ret);
} }
...@@ -518,7 +519,7 @@ static int input_open(struct input_dev *dev) ...@@ -518,7 +519,7 @@ static int input_open(struct input_dev *dev)
struct yealink_dev *yld = input_get_drvdata(dev); struct yealink_dev *yld = input_get_drvdata(dev);
int i, ret; int i, ret;
dev_dbg(&yld->idev->dev, "%s\n", __func__); dev_dbg(&yld->intf->dev, "%s\n", __func__);
/* force updates to device */ /* force updates to device */
for (i = 0; i<sizeof(yld->master); i++) for (i = 0; i<sizeof(yld->master); i++)
...@@ -533,7 +534,7 @@ static int input_open(struct input_dev *dev) ...@@ -533,7 +534,7 @@ static int input_open(struct input_dev *dev)
yld->ctl_data->size = 10; yld->ctl_data->size = 10;
yld->ctl_data->sum = 0x100-CMD_INIT-10; yld->ctl_data->sum = 0x100-CMD_INIT-10;
if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) { if ((ret = usb_submit_urb(yld->urb_ctl, GFP_KERNEL)) != 0) {
dev_dbg(&yld->idev->dev, dev_dbg(&yld->intf->dev,
"%s - usb_submit_urb failed with result %d\n", "%s - usb_submit_urb failed with result %d\n",
__func__, ret); __func__, ret);
return ret; return ret;
...@@ -884,6 +885,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -884,6 +885,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
return -ENOMEM; return -ENOMEM;
yld->udev = udev; yld->udev = udev;
yld->intf = intf;
yld->idev = input_dev = input_allocate_device(); yld->idev = input_dev = input_allocate_device();
if (!input_dev) if (!input_dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment