git: 3eae4e106ac7 - main - Fix error value returned by ofw_bus_gen_get_node().
Michal Meloun
mmel at FreeBSD.org
Thu Jun 24 10:05:37 UTC 2021
The branch main has been updated by mmel:
URL: https://cgit.FreeBSD.org/src/commit/?id=3eae4e106ac7222364fc9dc8c3d35d4ad8c5293a
commit 3eae4e106ac7222364fc9dc8c3d35d4ad8c5293a
Author: Michal Meloun <mmel at FreeBSD.org>
AuthorDate: 2021-06-24 09:56:20 +0000
Commit: Michal Meloun <mmel at FreeBSD.org>
CommitDate: 2021-06-24 10:01:05 +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
---
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 12fbafe4077f..ea57d1086779 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -144,7 +144,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);
}
More information about the dev-commits-src-all
mailing list