summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorRoderick Colenbrander <roderick.colenbrander@sony.com>2017-03-07 15:45:11 -0800
committerJiri Kosina <jkosina@suse.cz>2017-03-21 15:12:07 +0100
commitdf848bc05db1c49756a2befbe03ab03ce34a6bcc (patch)
tree391c2ade1c7737874eacd435192dd75d0c83a324 /drivers/hid
parent510c8b7c168bcad75e2864f73e5125d7218ee3cf (diff)
HID: sony: Perform duplicate device check earlier on
Game controllers can be connected twice through USB and BT. Only one connection is allowed. Currently we perform a check for duplicate controllers halfway through device initialization. To prevent 'transient' devices, we should do this check as early as we can. Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-sony.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index d8a13081701f..5eb5ac922c09 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2477,6 +2477,10 @@ static int sony_input_configured(struct hid_device *hdev,
goto err_stop;
}
+ ret = append_dev_id = sony_check_add(sc);
+ if (ret < 0)
+ goto err_stop;
+
ret = sony_allocate_output_report(sc);
if (ret < 0) {
hid_err(hdev, "failed to allocate the output report buffer\n");
@@ -2613,10 +2617,6 @@ static int sony_input_configured(struct hid_device *hdev,
if (ret < 0)
goto err_stop;
- ret = append_dev_id = sony_check_add(sc);
- if (ret < 0)
- goto err_stop;
-
if (sc->quirks & SONY_LED_SUPPORT) {
ret = sony_leds_init(sc);
if (ret < 0)