diff options
| author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2012-03-15 22:53:39 +0000 |
|---|---|---|
| committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2012-03-15 22:53:39 +0000 |
| commit | 0d8d9edaaaca133545e9c50bbc51a19ea2bd6006 (patch) | |
| tree | 766b9307623f628b6d7593bdc335d1907b8da19e | |
| parent | cd907a68aa6402276f2bfdbdcf2f907e6ab089c3 (diff) | |
Make ofw_bus_get_node() consistently return -1 when there is no associated
OF node, instead of a random mixture of 0 and -1. Update all checks for 0
to check for -1 instead.
MFC after: 4 weeks
Notes
Notes:
svn path=/head/; revision=233018
| -rw-r--r-- | sys/dev/ofw/ofw_bus_if.m | 2 | ||||
| -rw-r--r-- | sys/dev/ofw/ofw_bus_subr.c | 2 | ||||
| -rw-r--r-- | sys/dev/ofw/ofw_iicbus.c | 2 | ||||
| -rw-r--r-- | sys/dev/pcf/pcf_ebus.c | 2 | ||||
| -rw-r--r-- | sys/powerpc/ofw/ofw_pcib_pci.c | 2 | ||||
| -rw-r--r-- | sys/powerpc/ofw/ofw_pcibus.c | 2 | ||||
| -rw-r--r-- | sys/sparc64/pci/ofw_pcibus.c | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/ofw/ofw_bus_if.m b/sys/dev/ofw/ofw_bus_if.m index 446338c4551d..46fa281118d7 100644 --- a/sys/dev/ofw/ofw_bus_if.m +++ b/sys/dev/ofw/ofw_bus_if.m @@ -89,7 +89,7 @@ CODE { ofw_bus_default_get_node(device_t bus, device_t dev) { - return (0); + return (-1); } static const char * diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index cc648f5fc5c9..afe1393468df 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -157,7 +157,7 @@ ofw_bus_is_compatible(device_t dev, const char *onecompat) if ((compat = ofw_bus_get_compat(dev)) == NULL) return (0); - if ((node = ofw_bus_get_node(dev)) == 0) + if ((node = ofw_bus_get_node(dev)) == -1) return (0); /* Get total 'compatible' prop len */ diff --git a/sys/dev/ofw/ofw_iicbus.c b/sys/dev/ofw/ofw_iicbus.c index 906a49f572e7..63a0464cf016 100644 --- a/sys/dev/ofw/ofw_iicbus.c +++ b/sys/dev/ofw/ofw_iicbus.c @@ -88,7 +88,7 @@ static int ofw_iicbus_probe(device_t dev) { - if (ofw_bus_get_node(dev) == 0) + if (ofw_bus_get_node(dev) == -1) return (ENXIO); device_set_desc(dev, "OFW I2C bus"); diff --git a/sys/dev/pcf/pcf_ebus.c b/sys/dev/pcf/pcf_ebus.c index d354d9a0296b..b3a27377c948 100644 --- a/sys/dev/pcf/pcf_ebus.c +++ b/sys/dev/pcf/pcf_ebus.c @@ -147,7 +147,7 @@ pcf_ebus_attach(device_t dev) mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); /* get OFW node of the pcf */ - if ((node = ofw_bus_get_node(dev)) <= 0) { + if ((node = ofw_bus_get_node(dev)) == -1) { device_printf(dev, "cannot get OFW node\n"); goto error; } diff --git a/sys/powerpc/ofw/ofw_pcib_pci.c b/sys/powerpc/ofw/ofw_pcib_pci.c index 6d4bc7a000e2..d6c4168a61f2 100644 --- a/sys/powerpc/ofw/ofw_pcib_pci.c +++ b/sys/powerpc/ofw/ofw_pcib_pci.c @@ -93,7 +93,7 @@ ofw_pcib_pci_probe(device_t dev) return (ENXIO); } - if (ofw_bus_get_node(dev) == 0) + if (ofw_bus_get_node(dev) == -1) return (ENXIO); device_set_desc(dev, "OFW PCI-PCI bridge"); diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c index c611bb51a144..c3dfed00b937 100644 --- a/sys/powerpc/ofw/ofw_pcibus.c +++ b/sys/powerpc/ofw/ofw_pcibus.c @@ -105,7 +105,7 @@ static int ofw_pcibus_probe(device_t dev) { - if (ofw_bus_get_node(dev) == 0) + if (ofw_bus_get_node(dev) == -1) return (ENXIO); device_set_desc(dev, "OFW PCI bus"); diff --git a/sys/sparc64/pci/ofw_pcibus.c b/sys/sparc64/pci/ofw_pcibus.c index 9dd0e275aaf7..92b9f76d1bca 100644 --- a/sys/sparc64/pci/ofw_pcibus.c +++ b/sys/sparc64/pci/ofw_pcibus.c @@ -111,7 +111,7 @@ static int ofw_pcibus_probe(device_t dev) { - if (ofw_bus_get_node(dev) == 0) + if (ofw_bus_get_node(dev) == -1) return (ENXIO); device_set_desc(dev, "OFW PCI bus"); |
