acpi: Fix error code returned in acpi_bus_get_prop

ACPI implementation of device_get_property would return "-1" when
property was found, but it's type wasn't supported.
This causes device_has_property to return false in that scenario, which
arguably could be considered as incorrect.

Fix that by returning "0" in that case.

Reviewed by: bz, mw
Tested by: mw
MFC after: 2 weeks
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D33103
This commit is contained in:
Bartlomiej Grzesik 2021-11-22 15:05:57 +01:00 committed by Marcin Wojtas
parent 60c95f3163
commit d9ed1dcc5c

View File

@ -1849,9 +1849,10 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname,
memcpy(propvalue, obj->Buffer.Pointer,
MIN(size, obj->Buffer.Length));
return (obj->Buffer.Length);
}
return (-1);
default:
return (0);
}
}
int