Fix unsuccessful probing bug

probe_frid and probe_smbios will return -1 in case the probe fails,
e.g., due to no FRID data available, etc. There was a bug that was
copy-pasted to many platforms which would look at this -1 value as
non-zero, and indicate the probing was successful, this is the device.

The first platform in the list which did this was Auron_Buddy, due to
alphabetical sorting, but the same bug existed for many platforms.

This could be observed on a VM like betty where there was no FRID data
available:

localhost ~ # mosys platform name
Error probing CrOS EC via kernel driver
Buddy

This change changes many platforms to instead return -1 (for failed
probe) when this condition happens. Additionally, change the type
signature of probe_frid, probe_smbios, and strlfind to drop a nasty
cast while I'm here.

BUG=chromium:1052043
TEST=on betty, mosys platform name indicates the platform is not
supported, instead of identifying as an Auron_Buddy

Change-Id: I551fb38c73b658698340ced350f992517143fc31
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/mosys/+/2055610
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Eric Peers <epeers@google.com>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
13 files changed