HID: Return ENODEV instead of B_ERROR if the device was removed.

This should help with diagnosing problems in some failure conditions.
This commit is contained in:
Augustin Cavalier 2022-05-03 16:59:19 -04:00
parent 42c53fc8b8
commit d98fcb7db6
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ status_t
HIDDevice::MaybeScheduleTransfer(HIDReport *report)
{
if (fRemoved)
return B_ERROR;
return ENODEV;
if (atomic_get_and_set(&fTransferScheduled, 1) != 0) {
// someone else already caused a transfer to be scheduled

View File

@ -266,7 +266,7 @@ status_t
HIDDevice::MaybeScheduleTransfer(HIDReport*)
{
if (fRemoved)
return B_ERROR;
return ENODEV;
if (atomic_get_and_set(&fTransferScheduled, 1) != 0) {
// someone else already caused a transfer to be scheduled