diff options
| author | Roderick Colenbrander <roderick.colenbrander@sony.com> | 2017-03-07 15:45:11 -0800 |
|---|---|---|
| committer | Siarhei Vishniakou <svv@google.com> | 2019-11-07 11:15:02 -0600 |
| commit | 4828c25422d1bd387948b20052f1c816f54d6acb (patch) | |
| tree | 53565812d051fb9cb0900f5c4a23a75bf183b946 | |
| parent | a6af7ea4d6af6ad1f2d9be54f9aae1c7124bb504 (diff) | |
UPSTREAM: 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>
(cherry picked from commit df848bc05db1c49756a2befbe03ab03ce34a6bcc)
Bug: 111431828
Signed-off-by: Kim Low <kim-huei.low@sony.com>
Change-Id: Ibd372ee52c949c7d4a2dd86284a3e6cc3923b78a
Signed-off-by: Siarhei Vishniakou <svv@google.com>
| -rw-r--r-- | drivers/hid/hid-sony.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 1334295abb35..d737a59857d3 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2478,6 +2478,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"); @@ -2614,10 +2618,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) |
