summaryrefslogtreecommitdiffstats
path: root/sys/arm64
diff options
context:
space:
mode:
authorzbb <zbb@FreeBSD.org>2016-01-28 16:58:49 +0000
committerzbb <zbb@FreeBSD.org>2016-01-28 16:58:49 +0000
commit792baee6b7e046d5fba07463a8c505674df55600 (patch)
tree53f1d0928e06271614d4dff0918a6d6706fa765f /sys/arm64
parent482bbdb4222e936ab0ab18b5b14a366b4339aca4 (diff)
downloadFreeBSD-src-792baee6b7e046d5fba07463a8c505674df55600.zip
FreeBSD-src-792baee6b7e046d5fba07463a8c505674df55600.tar.gz
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
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/cavium/thunder_pcie_fdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm64/cavium/thunder_pcie_fdt.c b/sys/arm64/cavium/thunder_pcie_fdt.c
index bde4537..f1624f6 100644
--- a/sys/arm64/cavium/thunder_pcie_fdt.c
+++ b/sys/arm64/cavium/thunder_pcie_fdt.c
@@ -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));
}
OpenPOWER on IntegriCloud