git: 57dd17dd60e7 - stable/13 - Fix error value returned by ofw_bus_gen_get_node().

From: Michal Meloun <mmel_at_FreeBSD.org>
Date: Thu, 20 Jan 2022 10:06:14 UTC
The branch stable/13 has been updated by mmel:

URL: https://cgit.FreeBSD.org/src/commit/?id=57dd17dd60e7bb618ab2979df2d580559fcf3729

commit 57dd17dd60e7bb618ab2979df2d580559fcf3729
Author:     Michal Meloun <mmel@FreeBSD.org>
AuthorDate: 2021-06-24 09:56:20 +0000
Commit:     Michal Meloun <mmel@FreeBSD.org>
CommitDate: 2022-01-20 10:00:55 +0000

    Fix error value returned by ofw_bus_gen_get_node().
    
    By definition ofw_bus_get_node() should  consistently return -1 when there
    is no associated OF node.
    
    MFC after:      4 weeks
    Discussed with: nwhitehorn
    Analyzed in:    https://reviews.freebsd.org/D30761
    
    (cherry picked from commit 3eae4e106ac7222364fc9dc8c3d35d4ad8c5293a)
---
 sys/dev/ofw/ofw_bus_subr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index 5ce8d7b7bd48..a630e4333fd9 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -147,7 +147,7 @@ ofw_bus_gen_get_node(device_t bus, device_t dev)
 
 	obd = OFW_BUS_GET_DEVINFO(bus, dev);
 	if (obd == NULL)
-		return (0);
+		return ((phandle_t)-1);
 	return (obd->obd_node);
 }