Merge branch 'for-4.15/use-timer-setup' into for-linus
[muen/linux.git] / drivers / hid / usbhid / hid-core.c
index 045b5da9b992873ce74f5d401de34855b93a6f8e..640dfb937c6910f9ff9091a5a455b18c640f9edd 100644 (file)
@@ -101,10 +101,10 @@ static int hid_start_in(struct hid_device *hid)
 }
 
 /* I/O retry timer routine */
-static void hid_retry_timeout(unsigned long _hid)
+static void hid_retry_timeout(struct timer_list *t)
 {
-       struct hid_device *hid = (struct hid_device *) _hid;
-       struct usbhid_device *usbhid = hid->driver_data;
+       struct usbhid_device *usbhid = from_timer(usbhid, t, io_retry);
+       struct hid_device *hid = usbhid->hid;
 
        dev_dbg(&usbhid->intf->dev, "retrying intr urb\n");
        if (hid_start_in(hid))
@@ -1373,7 +1373,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
 
        init_waitqueue_head(&usbhid->wait);
        INIT_WORK(&usbhid->reset_work, hid_reset);
-       setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);
+       timer_setup(&usbhid->io_retry, hid_retry_timeout, 0);
        spin_lock_init(&usbhid->lock);
 
        ret = hid_add_device(hid);