diff options
| author | Bartlomiej Grzesik <bag@semihalf.com> | 2021-11-22 14:05:57 +0000 |
|---|---|---|
| committer | Marcin Wojtas <mw@FreeBSD.org> | 2021-11-24 18:42:43 +0000 |
| commit | d9ed1dcc5c6894e376e6e4ef6f2554dd056baf4e (patch) | |
| tree | 478a95eb0f36f1678181b56b66943630b5fc7ad3 | |
| parent | 60c95f316374fdd383f70b50e98ad097460accf3 (diff) | |
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
| -rw-r--r-- | sys/dev/acpica/acpi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 5d2b895bbe88..9b728b84bd12 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -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 |
