diff options
| author | Jayachandran C. <jchandra@FreeBSD.org> | 2011-12-02 15:24:39 +0000 |
|---|---|---|
| committer | Jayachandran C. <jchandra@FreeBSD.org> | 2011-12-02 15:24:39 +0000 |
| commit | 07042bef457cbb53d61c17e80067bec74ace43a8 (patch) | |
| tree | 282cdd7ec20de7056adfd64b8aed0bd16d32eb50 /sys/dev/ofw | |
| parent | c8973d9e6c23b5565f543c9bcfd090babcd60096 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ofw')
| -rw-r--r-- | sys/dev/ofw/ofw_fdt.c | 4 | ||||
| -rw-r--r-- | sys/dev/ofw/openfirm.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ofw/ofw_fdt.c b/sys/dev/ofw/ofw_fdt.c index 806f17c513d96..7b3b0e98dabb4 100644 --- a/sys/dev/ofw/ofw_fdt.c +++ b/sys/dev/ofw/ofw_fdt.c @@ -392,6 +392,8 @@ ofw_fdt_finddevice(ofw_t ofw, const char *device) int offset; offset = fdt_path_offset(fdtp, device); + if (offset < 0) + return (-1); return (fdt_offset_phandle(offset)); } @@ -420,7 +422,7 @@ ofw_fdt_fixup(ofw_t ofw) ssize_t len; int i; - if ((root = ofw_fdt_finddevice(ofw, "/")) == 0) + if ((root = ofw_fdt_finddevice(ofw, "/")) == -1) return (ENODEV); if ((len = ofw_fdt_getproplen(ofw, root, "model")) <= 0) diff --git a/sys/dev/ofw/openfirm.c b/sys/dev/ofw/openfirm.c index 9ff72dfc47a93..af6ee80695e5e 100644 --- a/sys/dev/ofw/openfirm.c +++ b/sys/dev/ofw/openfirm.c @@ -131,7 +131,7 @@ OF_init(void *cookie) rv = OFW_INIT(ofw_obj, cookie); - if ((chosen = OF_finddevice("/chosen")) > 0) + if ((chosen = OF_finddevice("/chosen")) != -1) if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) stdout = -1; |
