Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Jul 2021 18:35:53 GMT
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 94287656264f - main - ofw_pci: fix probing for non-DT cases
Message-ID:  <202107011835.161IZrAt009200@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mw:

URL: https://cgit.FreeBSD.org/src/commit/?id=94287656264fe1f984586220cb7fd2a2e6f89708

commit 94287656264fe1f984586220cb7fd2a2e6f89708
Author:     Kornel Duleba <mindal@semihalf.com>
AuthorDate: 2021-07-01 18:27:41 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
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");



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