From owner-svn-src-head@FreeBSD.ORG Thu Feb 3 18:07:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBCB1065672; Thu, 3 Feb 2011 18:07:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E43038FC0A; Thu, 3 Feb 2011 18:07:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p13I75lx053792; Thu, 3 Feb 2011 18:07:05 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p13I75Xh053790; Thu, 3 Feb 2011 18:07:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102031807.p13I75Xh053790@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 3 Feb 2011 18:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218228 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2011 18:07:06 -0000 Author: marcel Date: Thu Feb 3 18:07:05 2011 New Revision: 218228 URL: http://svn.freebsd.org/changeset/base/218228 Log: The FDT describes the host controller directly. There's no need to get properties from the parent. The parent is in fact the FDT bus itself and will therefore not have the properties we're looking for. Sponsored by: Juniper Networks Modified: head/sys/arm/mv/mv_pci.c Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Thu Feb 3 17:35:16 2011 (r218227) +++ head/sys/arm/mv/mv_pci.c Thu Feb 3 18:07:05 2011 (r218228) @@ -212,23 +212,17 @@ static struct mtx pcicfg_mtx; static int mv_pcib_probe(device_t self) { - phandle_t parnode; + phandle_t node; - /* - * The PCI subnode does not have the 'compatible' property, so we need - * to check in the parent PCI node. However the parent is not - * represented by a separate ofw_bus child, and therefore - * ofw_bus_is_compatible() cannot be used, but direct fdt equivalent. - */ - parnode = OF_parent(ofw_bus_get_node(self)); - if (parnode == 0) + node = ofw_bus_get_node(self); + if (!fdt_is_type(node, "pci")) return (ENXIO); - if (!(fdt_is_compatible(parnode, "mrvl,pcie") || - fdt_is_compatible(parnode, "mrvl,pci"))) + + if (!(fdt_is_compatible(node, "mrvl,pcie") || + fdt_is_compatible(node, "mrvl,pci"))) return (ENXIO); device_set_desc(self, "Marvell Integrated PCI/PCI-E Controller"); - return (BUS_PROBE_DEFAULT); } @@ -243,15 +237,16 @@ mv_pcib_attach(device_t self) sc = device_get_softc(self); sc->sc_dev = self; - parnode = OF_parent(ofw_bus_get_node(self)); - if (fdt_is_compatible(parnode, "mrvl,pcie")) { + node = ofw_bus_get_node(self); + parnode = OF_parent(node); + if (fdt_is_compatible(node, "mrvl,pcie")) { sc->sc_type = MV_TYPE_PCIE; sc->sc_mem_win_target = MV_WIN_PCIE_MEM_TARGET; sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR; sc->sc_io_win_target = MV_WIN_PCIE_IO_TARGET; sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR; #ifdef SOC_MV_ORION - } else if (fdt_is_compatible(parnode, "mrvl,pci")) { + } else if (fdt_is_compatible(node, "mrvl,pci")) { sc->sc_type = MV_TYPE_PCI; sc->sc_mem_win_target = MV_WIN_PCI_MEM_TARGET; sc->sc_mem_win_attr = MV_WIN_PCI_MEM_ATTR; @@ -261,8 +256,6 @@ mv_pcib_attach(device_t self) } else return (ENXIO); - node = ofw_bus_get_node(self); - /* * Get PCI interrupt info. */