AU: fix bug in GPIO handler that caused failed discovery to be ignored
This solves two issues:
* The GPIO handler will attempt to use GPIO devices even when discovery
via udev has failed. Not any more.
* GPIO discovery would return success even when it failed on a previous
attempt. Now it'll reflect the actual result of the discovery attempt.
* Reporting of file descriptor open errors is obscured due to
intermittent operations that reset errno, now fixed.
* Added test case to ensure that repeat GPIO discovery is not attempted,
and that test mode check will automatically fail if a previous
initialization/discovery had failed.
BUG=None
TEST=Passes unit tests
TEST=All symptoms gone on real update attempt w/ x86-alex
Change-Id: I01a7b1e316dbb5b94487a5aad1560d994feae9ff
Reviewed-on: https://gerrit.chromium.org/gerrit/40946
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
7 files changed