aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/yealink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/input/yealink.c')
-rw-r--r--drivers/usb/input/yealink.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c
index caff8e6d7448..c54f1a5dcb4a 100644
--- a/drivers/usb/input/yealink.c
+++ b/drivers/usb/input/yealink.c
@@ -502,7 +502,7 @@ static int input_ev(struct input_dev *dev, unsigned int type,
502 502
503static int input_open(struct input_dev *dev) 503static int input_open(struct input_dev *dev)
504{ 504{
505 struct yealink_dev *yld = dev->private; 505 struct yealink_dev *yld = input_get_drvdata(dev);
506 int i, ret; 506 int i, ret;
507 507
508 dbg("%s", __FUNCTION__); 508 dbg("%s", __FUNCTION__);
@@ -529,7 +529,7 @@ static int input_open(struct input_dev *dev)
529 529
530static void input_close(struct input_dev *dev) 530static void input_close(struct input_dev *dev)
531{ 531{
532 struct yealink_dev *yld = dev->private; 532 struct yealink_dev *yld = input_get_drvdata(dev);
533 533
534 usb_kill_urb(yld->urb_ctl); 534 usb_kill_urb(yld->urb_ctl);
535 usb_kill_urb(yld->urb_irq); 535 usb_kill_urb(yld->urb_irq);
@@ -937,9 +937,10 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
937 input_dev->name = nfo->name; 937 input_dev->name = nfo->name;
938 input_dev->phys = yld->phys; 938 input_dev->phys = yld->phys;
939 usb_to_input_id(udev, &input_dev->id); 939 usb_to_input_id(udev, &input_dev->id);
940 input_dev->cdev.dev = &intf->dev; 940 input_dev->dev.parent = &intf->dev;
941
942 input_set_drvdata(input_dev, yld);
941 943
942 input_dev->private = yld;
943 input_dev->open = input_open; 944 input_dev->open = input_open;
944 input_dev->close = input_close; 945 input_dev->close = input_close;
945 /* input_dev->event = input_ev; TODO */ 946 /* input_dev->event = input_ev; TODO */
@@ -955,7 +956,9 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
955 } 956 }
956 } 957 }
957 958
958 input_register_device(yld->idev); 959 ret = input_register_device(yld->idev);
960 if (ret)
961 return usb_cleanup(yld, ret);
959 962
960 usb_set_intfdata(intf, yld); 963 usb_set_intfdata(intf, yld);
961 964