Commit df848bc0 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Jiri Kosina

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: default avatarRoderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 510c8b7c
......@@ -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");
......@@ -2610,10 +2614,6 @@ static int sony_input_configured(struct hid_device *hdev,
ret = 0;
}
if (ret < 0)
goto err_stop;
ret = append_dev_id = sony_check_add(sc);
if (ret < 0)
goto err_stop;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment