From owner-svn-src-all@FreeBSD.ORG Thu Apr 12 00:38:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB7751065672; Thu, 12 Apr 2012 00:38:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C426E8FC0A; Thu, 12 Apr 2012 00:38:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3C0cYvi002778; Thu, 12 Apr 2012 00:38:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3C0cYxx002770; Thu, 12 Apr 2012 00:38:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204120038.q3C0cYxx002770@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 12 Apr 2012 00:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234160 - in stable/9/sys: dev/ofw dev/pcf powerpc/ofw sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 00:38:35 -0000 Author: nwhitehorn Date: Thu Apr 12 00:38:34 2012 New Revision: 234160 URL: http://svn.freebsd.org/changeset/base/234160 Log: MFC r233018: 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. Modified: stable/9/sys/dev/ofw/ofw_bus_if.m stable/9/sys/dev/ofw/ofw_bus_subr.c stable/9/sys/dev/ofw/ofw_iicbus.c stable/9/sys/dev/pcf/pcf_ebus.c stable/9/sys/powerpc/ofw/ofw_pcib_pci.c stable/9/sys/powerpc/ofw/ofw_pcibus.c stable/9/sys/sparc64/pci/ofw_pcibus.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- stable/9/sys/dev/ofw/ofw_bus_if.m Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/dev/ofw/ofw_bus_if.m Thu Apr 12 00:38:34 2012 (r234160) @@ -89,7 +89,7 @@ CODE { ofw_bus_default_get_node(device_t bus, device_t dev) { - return (0); + return (-1); } static const char * Modified: stable/9/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/9/sys/dev/ofw/ofw_bus_subr.c Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/dev/ofw/ofw_bus_subr.c Thu Apr 12 00:38:34 2012 (r234160) @@ -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: stable/9/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- stable/9/sys/dev/ofw/ofw_iicbus.c Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/dev/ofw/ofw_iicbus.c Thu Apr 12 00:38:34 2012 (r234160) @@ -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: stable/9/sys/dev/pcf/pcf_ebus.c ============================================================================== --- stable/9/sys/dev/pcf/pcf_ebus.c Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/dev/pcf/pcf_ebus.c Thu Apr 12 00:38:34 2012 (r234160) @@ -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: stable/9/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_pcib_pci.c Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/powerpc/ofw/ofw_pcib_pci.c Thu Apr 12 00:38:34 2012 (r234160) @@ -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: stable/9/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/9/sys/powerpc/ofw/ofw_pcibus.c Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/powerpc/ofw/ofw_pcibus.c Thu Apr 12 00:38:34 2012 (r234160) @@ -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: stable/9/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- stable/9/sys/sparc64/pci/ofw_pcibus.c Thu Apr 12 00:12:17 2012 (r234159) +++ stable/9/sys/sparc64/pci/ofw_pcibus.c Thu Apr 12 00:38:34 2012 (r234160) @@ -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");