summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-logitech-dj.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 386040b04992..f0916ebfcf8f 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -452,7 +452,7 @@ static void delayedwork_callback(struct work_struct *work)
/* Device is connected, but only now paired. Fallthrough.
Note: If we fallthrough here, we should not fallthrough
the next case, since that's the case for connection status
- info arriving before paried. */
+ info arriving before paired. */
case REPORT_TYPE_NOTIF_CONNECTION_STATUS:
if (dj_report.report_type == REPORT_TYPE_NOTIF_CONNECTION_STATUS) {
param_status = dj_report.report_params[
@@ -472,6 +472,7 @@ static void delayedwork_callback(struct work_struct *work)
dev_err(&djrcv_hdev->dev,
"%s: failed adding dj_device\n",
__func__);
+ return;
} else {
djdev->hid_device_started = 1;
}
@@ -482,7 +483,6 @@ static void delayedwork_callback(struct work_struct *work)
return;
}
hidpp_connect_change(hidpp_dev, connected);
- break;
}
/* Fallthrough for case where djdev is NULL. */
default:
@@ -494,7 +494,7 @@ static void delayedwork_callback(struct work_struct *work)
* hid-core discards all packets coming from a device while probe() is
* executing. */
if (!djrcv_dev->paired_dj_devices[dj_report.device_index]) {
- /* ok, we don't know the device that just got conntected, just
+ /* ok, we don't know the device that just got connected, just
* re-ask the receiver for the list of connected devices. */
djrcv_dev->connected[dj_report.device_index] = true;
retval = logi_dj_recv_query_paired_devices(djrcv_dev);
@@ -1029,12 +1029,18 @@ static int logi_dj_probe(struct hid_device *hdev,
/* Allow incoming packets to arrive: */
hid_device_io_start(hdev);
- /* Normally we'd query for paired devices here, but some controllers
- don't successfully send (or recieve?) the messages for this. Instead,
- we'll wait for packets to arrive and issue a query then. */
+ retval = logi_dj_recv_query_paired_devices(djrcv_dev);
+ if (retval < 0) {
+ dev_err(&hdev->dev, "%s:logi_dj_recv_query_paired_devices "
+ "error:%d\n", __func__, retval);
+ goto logi_dj_recv_query_paired_devices_failed;
+ }
return retval;
+logi_dj_recv_query_paired_devices_failed:
+ hdev->ll_driver->close(hdev);
+
llopen_failed:
switch_to_dj_mode_fail:
hid_hw_stop(hdev);