Check for a 'pci' prefix rather than a full match in get_addr_props

Summary:
Newer OPAL device trees, such as those on POWER9 systems, use 'pciex' for
device_type, not 'pci'.  Rather than enumerating all possible variants, just
check for a 'pci' prefix.

Reviewed by:	nwhitehorn, breno.leitao_gmail.com
Differential Revision: https://reviews.freebsd.org/D15817
This commit is contained in:
Justin Hibbits 2018-06-15 18:55:02 +00:00
parent c4273800ae
commit 6f3fcd7693

View File

@ -61,7 +61,9 @@ get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip)
res = OF_getprop(node, "device_type", type, sizeof(type));
if (res != -1) {
type[sizeof(type) - 1] = '\0';
pci = (strcmp(type, "pci") == 0) ? 1 : 0;
if (strcmp(type, "pci") == 0 ||
strcmp(type, "pciex")== 0)
pci = 1;
}
}
if (addrp != NULL)