aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/input/wacom_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/input/wacom_sys.c')
-rw-r--r--drivers/usb/input/wacom_sys.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/usb/input/wacom_sys.c b/drivers/usb/input/wacom_sys.c
index 12b42746ded..1fe48208c2f 100644
--- a/drivers/usb/input/wacom_sys.c
+++ b/drivers/usb/input/wacom_sys.c
@@ -122,7 +122,7 @@ void wacom_input_sync(void *wcombo)
static int wacom_open(struct input_dev *dev)
{
- struct wacom *wacom = dev->private;
+ struct wacom *wacom = input_get_drvdata(dev);
wacom->irq->dev = wacom->usbdev;
if (usb_submit_urb(wacom->irq, GFP_KERNEL))
@@ -133,7 +133,7 @@ static int wacom_open(struct input_dev *dev)
static void wacom_close(struct input_dev *dev)
{
- struct wacom *wacom = dev->private;
+ struct wacom *wacom = input_get_drvdata(dev);
usb_kill_urb(wacom->irq);
}
@@ -201,6 +201,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
struct wacom *wacom;
struct wacom_wac *wacom_wac;
struct input_dev *input_dev;
+ int error = -ENOMEM;
char rep_data[2], limit = 0;
wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
@@ -229,8 +230,10 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
wacom->wacom_wac = wacom_wac;
usb_to_input_id(dev, &input_dev->id);
- input_dev->cdev.dev = &intf->dev;
- input_dev->private = wacom;
+ input_dev->dev.parent = &intf->dev;
+
+ input_set_drvdata(input_dev, wacom);
+
input_dev->open = wacom_open;
input_dev->close = wacom_close;
@@ -252,7 +255,9 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
wacom->irq->transfer_dma = wacom->data_dma;
wacom->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
- input_register_device(wacom->dev);
+ error = input_register_device(wacom->dev);
+ if (error)
+ goto fail3;
/* Ask the tablet to report tablet data. Repeat until it succeeds */
do {
@@ -265,11 +270,12 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
usb_set_intfdata(intf, wacom);
return 0;
-fail2: usb_buffer_free(dev, 10, wacom_wac->data, wacom->data_dma);
-fail1: input_free_device(input_dev);
+ fail3: usb_free_urb(wacom->irq);
+ fail2: usb_buffer_free(dev, 10, wacom_wac->data, wacom->data_dma);
+ fail1: input_free_device(input_dev);
kfree(wacom);
kfree(wacom_wac);
- return -ENOMEM;
+ return error;
}
static void wacom_disconnect(struct usb_interface *intf)