Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2012 22:53:40 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233018 - in head/sys: dev/ofw dev/pcf powerpc/ofw sparc64/pci
Message-ID:  <201203152253.q2FMreAK086987@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Thu Mar 15 22:53:39 2012
New Revision: 233018
URL: http://svn.freebsd.org/changeset/base/233018

Log:
  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

Modified:
  head/sys/dev/ofw/ofw_bus_if.m
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_iicbus.c
  head/sys/dev/pcf/pcf_ebus.c
  head/sys/powerpc/ofw/ofw_pcib_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/sparc64/pci/ofw_pcibus.c

Modified: head/sys/dev/ofw/ofw_bus_if.m
==============================================================================
--- head/sys/dev/ofw/ofw_bus_if.m	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/dev/ofw/ofw_bus_if.m	Thu Mar 15 22:53:39 2012	(r233018)
@@ -89,7 +89,7 @@ CODE {
 	ofw_bus_default_get_node(device_t bus, device_t dev)
 	{
 
-		return (0);
+		return (-1);
 	}
 
 	static const char *

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/dev/ofw/ofw_bus_subr.c	Thu Mar 15 22:53:39 2012	(r233018)
@@ -157,7 +157,7 @@ ofw_bus_is_compatible(device_t dev, cons
 	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 */

Modified: head/sys/dev/ofw/ofw_iicbus.c
==============================================================================
--- head/sys/dev/ofw/ofw_iicbus.c	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/dev/ofw/ofw_iicbus.c	Thu Mar 15 22:53:39 2012	(r233018)
@@ -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");
 

Modified: head/sys/dev/pcf/pcf_ebus.c
==============================================================================
--- head/sys/dev/pcf/pcf_ebus.c	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/dev/pcf/pcf_ebus.c	Thu Mar 15 22:53:39 2012	(r233018)
@@ -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;
 	}

Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_pcib_pci.c	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/powerpc/ofw/ofw_pcib_pci.c	Thu Mar 15 22:53:39 2012	(r233018)
@@ -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");

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_pcibus.c	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/powerpc/ofw/ofw_pcibus.c	Thu Mar 15 22:53:39 2012	(r233018)
@@ -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");
 

Modified: head/sys/sparc64/pci/ofw_pcibus.c
==============================================================================
--- head/sys/sparc64/pci/ofw_pcibus.c	Thu Mar 15 22:50:48 2012	(r233017)
+++ head/sys/sparc64/pci/ofw_pcibus.c	Thu Mar 15 22:53:39 2012	(r233018)
@@ -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");
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203152253.q2FMreAK086987>