Merge branch 'for-4.19/upstream' into for-linus
authorJiri Kosina <jkosina@suse.cz>
Mon, 20 Aug 2018 16:11:20 +0000 (18:11 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 20 Aug 2018 16:11:20 +0000 (18:11 +0200)
Assorted small driver/core fixes.

drivers/hid/hid-ntrig.c
drivers/hid/hid-redragon.c
drivers/hid/intel-ish-hid/ishtp/hbm.c
drivers/hid/usbhid/hid-core.c

index 43b1c72343162ea09e4ed5bbe99581fc826565be..9bc6f4867cb3b82e0b0eb9202ce6b20b4eb548a7 100644 (file)
@@ -955,6 +955,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
 
        ret = sysfs_create_group(&hdev->dev.kobj,
                        &ntrig_attribute_group);
+       if (ret)
+               hid_err(hdev, "cannot create sysfs group\n");
 
        return 0;
 err_free:
index daf59578bf933ea042c291693d1d60538fc329b1..73c9d4c4fa34dbcb9f073c3f34cbe37b148688b9 100644 (file)
@@ -44,29 +44,6 @@ static __u8 *redragon_report_fixup(struct hid_device *hdev, __u8 *rdesc,
        return rdesc;
 }
 
-static int redragon_probe(struct hid_device *dev,
-       const struct hid_device_id *id)
-{
-       int ret;
-
-       ret = hid_parse(dev);
-       if (ret) {
-               hid_err(dev, "parse failed\n");
-               return ret;
-       }
-
-       /* do not register unused input device */
-       if (dev->maxapplication == 1)
-               return 0;
-
-       ret = hid_hw_start(dev, HID_CONNECT_DEFAULT);
-       if (ret) {
-               hid_err(dev, "hw start failed\n");
-               return ret;
-       }
-
-       return 0;
-}
 static const struct hid_device_id redragon_devices[] = {
        {HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_REDRAGON_ASURA)},
        {}
@@ -77,8 +54,7 @@ MODULE_DEVICE_TABLE(hid, redragon_devices);
 static struct hid_driver redragon_driver = {
        .name = "redragon",
        .id_table = redragon_devices,
-       .report_fixup = redragon_report_fixup,
-       .probe = redragon_probe
+       .report_fixup = redragon_report_fixup
 };
 
 module_hid_driver(redragon_driver);
index ae4a69f7f2f48d23b50aa639ac69cc68b04d8f3a..8b5dd580ceec37885456118111c1f2f1f2ca7a01 100644 (file)
@@ -298,7 +298,6 @@ int ishtp_hbm_cl_flow_control_req(struct ishtp_device *dev,
        struct ishtp_msg_hdr *ishtp_hdr = &hdr;
        const size_t len = sizeof(struct hbm_flow_control);
        int     rv;
-       unsigned int    num_frags;
        unsigned long   flags;
 
        spin_lock_irqsave(&cl->fc_spinlock, flags);
@@ -314,7 +313,6 @@ int ishtp_hbm_cl_flow_control_req(struct ishtp_device *dev,
                return  0;
        }
 
-       num_frags = cl->recv_msg_num_frags;
        cl->recv_msg_num_frags = 0;
 
        rv = ishtp_write_message(dev, ishtp_hdr, data);
index af0e0d061b157c56779c77a399871a539d360846..11103efebbaa86e5bf156de6a40544f0278026ca 100644 (file)
@@ -480,6 +480,7 @@ static void hid_ctrl(struct urb *urb)
 {
        struct hid_device *hid = urb->context;
        struct usbhid_device *usbhid = hid->driver_data;
+       unsigned long flags;
        int unplug = 0, status = urb->status;
 
        switch (status) {
@@ -501,7 +502,7 @@ static void hid_ctrl(struct urb *urb)
                hid_warn(urb->dev, "ctrl urb status %d received\n", status);
        }
 
-       spin_lock(&usbhid->lock);
+       spin_lock_irqsave(&usbhid->lock, flags);
 
        if (unplug) {
                usbhid->ctrltail = usbhid->ctrlhead;
@@ -511,13 +512,13 @@ static void hid_ctrl(struct urb *urb)
                if (usbhid->ctrlhead != usbhid->ctrltail &&
                                hid_submit_ctrl(hid) == 0) {
                        /* Successfully submitted next urb in queue */
-                       spin_unlock(&usbhid->lock);
+                       spin_unlock_irqrestore(&usbhid->lock, flags);
                        return;
                }
        }
 
        clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
-       spin_unlock(&usbhid->lock);
+       spin_unlock_irqrestore(&usbhid->lock, flags);
        usb_autopm_put_interface_async(usbhid->intf);
        wake_up(&usbhid->wait);
 }