struct yealink_dev {
struct input_dev *idev; /* input device */
struct usb_device *udev; /* usb device */
+ struct usb_interface *intf; /* usb interface */
/* irq input channel */
struct yld_ctl_packet *irq_data;
int ret, status = urb->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);
switch (yld->irq_data->cmd) {
break;
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]);
report_key(yld, map_p1k_to_key(yld->irq_data->data[0]));
break;
default:
- dev_err(&yld->idev->dev, "unexpected response %x\n",
+ dev_err(&yld->intf->dev, "unexpected response %x\n",
yld->irq_data->cmd);
}
if (!yld->shutdown) {
ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
if (ret && ret != -EPERM)
- dev_err(&yld->idev->dev,
+ dev_err(&yld->intf->dev,
"%s - usb_submit_urb failed %d\n",
__func__, ret);
}
int ret = 0, status = urb->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);
switch (yld->ctl_data->cmd) {
}
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);
}
struct yealink_dev *yld = input_get_drvdata(dev);
int i, ret;
- dev_dbg(&yld->idev->dev, "%s\n", __func__);
+ dev_dbg(&yld->intf->dev, "%s\n", __func__);
/* force updates to device */
for (i = 0; i<sizeof(yld->master); i++)
yld->ctl_data->size = 10;
yld->ctl_data->sum = 0x100-CMD_INIT-10;
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",
__func__, ret);
return ret;
return -ENOMEM;
yld->udev = udev;
+ yld->intf = intf;
yld->idev = input_dev = input_allocate_device();
if (!input_dev)