Fix VNIC enumeration after r294993 and r294990

ofw_bus_get_node() must be tested against negative values since
missing parent bus method will result in calling the default method
which simply returns (-1): sys/dev/ofw/ofw_bus_if.m
This was lost in the review process.

Obtained from: Semihalf
Sponsored by:  Cavium
This commit is contained in:
Zbigniew Bodek 2016-01-28 16:58:49 +00:00
parent 009d75e764
commit db7cfc199e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294998
2 changed files with 3 additions and 3 deletions

View File

@ -276,7 +276,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
int i;
/* For PCIe devices that do not have FDT nodes, use PCIB method */
if (ofw_bus_get_node(child) == 0) {
if ((int)ofw_bus_get_node(child) <= 0) {
return (thunder_pcie_alloc_resource(bus, child, type, rid,
start, end, count, flags));
}
@ -329,7 +329,7 @@ thunder_pcie_ofw_bus_rel_res(device_t bus, device_t child, int type, int rid,
{
/* For PCIe devices that do not have FDT nodes, use PCIB method */
if (ofw_bus_get_node(child) == 0) {
if ((int)ofw_bus_get_node(child) <= 0) {
return (thunder_pcie_release_resource(bus,
child, type, rid, res));
}

View File

@ -244,7 +244,7 @@ bgx_fdt_find_node(struct bgx *bgx)
}
node = ofw_bus_get_node(root_pcib);
if (node == 0) {
if ((int)node <= 0) {
device_printf(bgx->dev, "No parent FDT node for BGX\n");
goto out;
}