Fix error check for ACPI_ID_PROBE in the TPM2.0 driver

Updated API does not return pointer, so adjust the
TPM2.0 driver accordingly.

Reported by: jhb
Obtained from: Semihalf
Sponsored by: Stormshield
This commit is contained in:
mw 2018-12-14 22:22:43 +00:00
parent 0c9d4f297b
commit 9aa3cccd72
2 changed files with 8 additions and 6 deletions

View File

@ -104,11 +104,12 @@ static int
tpmcrb_acpi_probe(device_t dev)
{
struct resource *res;
int rid = 0;
int err, rid = 0;
uint32_t caps;
if (ACPI_ID_PROBE(device_get_parent(dev), dev, tpmcrb_ids, NULL) == NULL)
return (ENXIO);
err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmcrb_ids, NULL);
if (err > 0)
return (err);
/* Check if device is in CRB mode */
res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);

View File

@ -101,11 +101,12 @@ static int
tpmtis_acpi_probe(device_t dev)
{
struct resource *res;
int rid = 0;
int err, rid = 0;
uint32_t caps;
if (ACPI_ID_PROBE(device_get_parent(dev), dev, tpmtis_ids, NULL) == NULL)
return (ENXIO);
err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmtis_ids, NULL);
if (err > 0)
return (err);
/* Check if device is in TPM 2.0 TIS mode */
res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);