From 39335d1cbb8fb3260ac5f18fbcc45beb690e5ebd Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 20 Mar 2018 12:04:49 +0100 Subject: HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT 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 Acked-by: Peter Hutterer Signed-off-by: Jiri Kosina --- drivers/hid/hid-input.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/hid/hid-input.c') diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 04d01b57d94c..b237b5590227 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -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; -- cgit v1.2.3