struct atp {
char phys[64];
struct usb_device *udev; /* usb device */
+ struct usb_interface *intf; /* usb interface */
struct urb *urb; /* usb request block */
u8 *data; /* transferred data */
struct input_dev *input; /* input dev */
data = kmalloc(8, GFP_KERNEL);
if (!data) {
- dev_err(&dev->input->dev, "Out of memory\n");
+ dev_err(&dev->intf->dev, "Out of memory\n");
return -ENOMEM;
}
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);
- dev_err(&dev->input->dev, "Failed to read mode from device.\n");
+ dev_err(&dev->intf->dev, "Failed to read mode from device.\n");
ret = -EIO;
goto out_free;
}
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);
- dev_err(&dev->input->dev, "Failed to request geyser raw mode\n");
+ dev_err(&dev->intf->dev, "Failed to request geyser raw mode\n");
ret = -EIO;
goto out_free;
}
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->input->dev,
+ dev_err(&dev->intf->dev,
"atp_reinit: usb_submit_urb failed with error %d\n",
retval);
}
{
struct atp *dev = urb->context;
struct input_dev *idev = dev->input;
+ struct usb_interface *intf = dev->intf;
switch (urb->status) {
case 0:
break;
case -EOVERFLOW:
if (!dev->overflow_warned) {
- dev_warn(&idev->dev,
+ dev_warn(&intf->dev,
"appletouch: OVERFLOW with data length %d, actual length is %d\n",
dev->info->datalen, dev->urb->actual_length);
dev->overflow_warned = true;
case -ENOENT:
case -ESHUTDOWN:
/* This urb is terminated, clean up */
- dev_dbg(&idev->dev,
+ dev_dbg(&intf->dev,
"atp_complete: urb shutting down with status: %d\n",
urb->status);
return ATP_URB_STATUS_ERROR_FATAL;
default:
- dev_dbg(&idev->dev,
+ dev_dbg(&intf->dev,
"atp_complete: nonzero urb status received: %d\n",
urb->status);
return ATP_URB_STATUS_ERROR;
for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) {
if (dev->xy_cur[i]) {
- dev_info(&dev->input->dev,
+ dev_info(&dev->intf->dev,
"appletouch: 17\" model detected.\n");
input_set_abs_params(dev->input, ABS_X, 0,
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->input->dev,
+ dev_err(&dev->intf->dev,
"atp_complete: usb_submit_urb failed with result %d\n",
retval);
}
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->input->dev,
+ dev_err(&dev->intf->dev,
"atp_complete: usb_submit_urb failed with result %d\n",
retval);
}
if (atp_geyser_init(dev))
return -EIO;
- dev_info(&dev->input->dev, "Geyser mode initialized.\n");
+ dev_info(&dev->intf->dev, "Geyser mode initialized.\n");
}
return 0;
}
dev->udev = udev;
+ dev->intf = iface;
dev->input = input_dev;
dev->info = info;
dev->overflow_warned = false;
usb_free_urb(dev->urb);
kfree(dev);
}
- printk(KERN_INFO "input: appletouch disconnected\n");
+ dev_info(&iface->dev, "input: appletouch disconnected\n");
}
static int atp_recover(struct atp *dev)