From owner-dev-commits-src-main@freebsd.org Thu Jul 1 18:35:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C70B650B4E; Thu, 1 Jul 2021 18:35:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GG6NT45Zwz4kLL; Thu, 1 Jul 2021 18:35:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75116253F9; Thu, 1 Jul 2021 18:35:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 161IZrh9009201; Thu, 1 Jul 2021 18:35:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 161IZrAt009200; Thu, 1 Jul 2021 18:35:53 GMT (envelope-from git) Date: Thu, 1 Jul 2021 18:35:53 GMT Message-Id: <202107011835.161IZrAt009200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 94287656264f - main - ofw_pci: fix probing for non-DT cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94287656264fe1f984586220cb7fd2a2e6f89708 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2021 18:35:53 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=94287656264fe1f984586220cb7fd2a2e6f89708 commit 94287656264fe1f984586220cb7fd2a2e6f89708 Author: Kornel Duleba AuthorDate: 2021-07-01 18:27:41 +0000 Commit: Marcin Wojtas CommitDate: 2021-07-01 18:35:23 +0000 ofw_pci: fix probing for non-DT cases phandle_t is a uint32_t type, <= 0 comparison doesn't work with it as intended. This caused the ofw_pci code to attach to PCI bus on ACPI based systems. Since 3eae4e106ac7 ("Fix error value returned by ofw_bus_gen_get_node().") ofw subsystem can only return -1 for invalid nodes. Use that. MFC after: 4 weeks Reviewed by: mw Differential revision: https://reviews.freebsd.org/D30953 --- sys/dev/ofw/ofw_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ofw/ofw_pci.c b/sys/dev/ofw/ofw_pci.c index c7ed7c5c8fe9..7f7aad379ddc 100644 --- a/sys/dev/ofw/ofw_pci.c +++ b/sys/dev/ofw/ofw_pci.c @@ -77,7 +77,7 @@ ofw_pci_probe(device_t dev) device_t parent; parent = device_get_parent(dev); - if (ofw_bus_get_node(parent) <= 0) + if (ofw_bus_get_node(parent) == -1) return (ENXIO); device_set_desc(dev, "OFW PCI bus");