mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
HID: steam: Don't set feature reports when disconnecting
When an input device is closed, we set a feature report to reset lizard mode and IMU mode. However, if the input device is closed because it was removed, then we will necessarily error out when sending this, resulting in logged errors. Since an error here is expected, we should just fail silently. Signed-off-by: Vicki Pfau <vi@endrift.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
0a0028c2aa
commit
cfa66cba6d
|
|
@ -490,9 +490,13 @@ static int steam_recv_report_id(struct steam_device *steam,
|
|||
}
|
||||
|
||||
kfree(buf);
|
||||
if (ret < 0)
|
||||
/*
|
||||
* Don't log if the failure is -ENODEV, as this
|
||||
* can happen normally on disconnect.
|
||||
*/
|
||||
if (ret < 0 && ret != -ENODEV)
|
||||
hid_err(steam->hdev, "%s: error %d\n", __func__, ret);
|
||||
else
|
||||
else if (ret > 0)
|
||||
hid_dbg(steam->hdev, "Received report %*ph\n", size, data);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
@ -557,7 +561,11 @@ static int steam_send_report_id(struct steam_device *steam,
|
|||
} while (--retries);
|
||||
|
||||
kfree(buf);
|
||||
if (ret < 0)
|
||||
/*
|
||||
* Don't log if the failure is -ENODEV, as this
|
||||
* can happen normally on disconnect.
|
||||
*/
|
||||
if (ret < 0 && ret != -ENODEV)
|
||||
hid_err(steam->hdev, "%s: error %d (%*ph)\n", __func__,
|
||||
ret, size, cmd);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user