]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 20 Mar 2018 11:04:49 +0000 (12:04 +0100)
committerJiri Kosina <jkosina@suse.cz>
Fri, 23 Mar 2018 14:44:57 +0000 (15:44 +0100)
There is no real point of registering an empty input node.
This should be default, but given some drivers need the blank input
node to set it up during input_configured, we need to postpone
the check for hidinput_has_been_populated().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-asus.c
drivers/hid/hid-input.c
drivers/hid/hid-multitouch.c
drivers/hid/hid-uclogic.c
include/linux/hid.h

index 88b9703318e404602f8b4733552d0d06be363103..cc738ebf93ac1033f2c6e9230a9e57a251414899 100644 (file)
@@ -644,8 +644,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
                 * All functionality is on a single HID interface and for
                 * userspace the touchpad must be a separate input_dev.
                 */
-               hdev->quirks |= HID_QUIRK_MULTI_INPUT |
-                               HID_QUIRK_NO_EMPTY_INPUT;
+               hdev->quirks |= HID_QUIRK_MULTI_INPUT;
                drvdata->tp = &asus_t100chi_tp;
        }
 
index 04d01b57d94c8280d2d6a63ef863136165555c11..b237b5590227b1e7142f025671a44d17c85acfa8 100644 (file)
@@ -1656,16 +1656,16 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
        }
 
        list_for_each_entry_safe(hidinput, next, &hid->inputs, list) {
-               if ((hid->quirks & HID_QUIRK_NO_EMPTY_INPUT) &&
-                   !hidinput_has_been_populated(hidinput)) {
+               if (drv->input_configured &&
+                   drv->input_configured(hid, hidinput))
+                       goto out_unwind;
+
+               if (!hidinput_has_been_populated(hidinput)) {
                        /* no need to register an input device not populated */
                        hidinput_cleanup_hidinput(hid, hidinput);
                        continue;
                }
 
-               if (drv->input_configured &&
-                   drv->input_configured(hid, hidinput))
-                       goto out_unwind;
                if (input_register_device(hidinput->input))
                        goto out_unwind;
                hidinput->registered = true;
index bc724e6b75c9152f8bb5a269c942ff618dbe73dd..c4d89830cd1f27c6f3da2934be6f1f9707c5e2e6 100644 (file)
@@ -1469,7 +1469,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
         * device.
         */
        hdev->quirks |= HID_QUIRK_MULTI_INPUT;
-       hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
 
        /*
         * Some multitouch screens do not like to be polled for input
index e3e6e5c893cc05e0c934c8c9f505de9fdd06e26a..56b196d600411ec7e5b18170b058b6445a97e5ae 100644 (file)
@@ -946,7 +946,6 @@ static int uclogic_probe(struct hid_device *hdev,
         * than the pen, so use QUIRK_MULTI_INPUT for all tablets.
         */
        hdev->quirks |= HID_QUIRK_MULTI_INPUT;
-       hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
 
        /* Allocate and assign driver data */
        drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
index bc92005e5f0828c2da97e968b2df6456c03b75b3..b0db16fa709338002f2890b6ab138804a1f8101e 100644 (file)
@@ -338,7 +338,7 @@ struct hid_item {
 #define HID_QUIRK_BADPAD                       BIT(5)
 #define HID_QUIRK_MULTI_INPUT                  BIT(6)
 #define HID_QUIRK_HIDINPUT_FORCE               BIT(7)
-#define HID_QUIRK_NO_EMPTY_INPUT               BIT(8)
+/* BIT(8) reserved for backward compatibility, was HID_QUIRK_NO_EMPTY_INPUT */
 /* BIT(9) reserved for backward compatibility, was NO_INIT_INPUT_REPORTS */
 #define HID_QUIRK_ALWAYS_POLL                  BIT(10)
 #define HID_QUIRK_SKIP_OUTPUT_REPORTS          BIT(16)