HomeFreeBSD

acpi/ec: Fix regression caused by r340644

Description

acpi/ec: Fix regression caused by r340644

After r340644 there were two things wrong in cases where there is both
an ECDT, and an EC device exposed via acpica. The first is a rather
trivial situation where the device desc would say ECDT even when it was
not implicitly created via ECDT (not really sure why the compiler
doesn't seem to warn about this).

The other more pervasive issue is that the code is designed to
essentially not do anything for EC probe when its uid was already
created an EC based on the ECDT's uid. The issue was that probe would
still return 0 in this case, and so we'd end up with some weird
duplication. Now to be honest, I'm not actually sure what exactly broke,
but it was definitely not working as intended. To fix this, all that is
really needed is to make sure we return ENXIO when we're probing the
device already added for the ECDT entry. While here though, move the
check for this earlier to avoid wasted cycles when we know after
obtaining the uid that it's duplicative.

There remains one questionable bit here which I don't want to touch -
when doing probe for PNP0C09, if acquiring _UID for the device fails, 0
is assumed, which is a valid UID used by the implicit ECDT.

Reported by: Charlie Li, et al.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D18311

Details

Provenance
bwidawskAuthored on
Reviewer
jhb
Differential Revision
D18311: Summary: acpi/ec: Fix regression caused by r340644
Parents
rS340992: Add ga_IE.UTF-8 locale.
Branches
Unknown
Tags
Unknown