Index: sys/arm/amlogic/aml8726/aml8726_clkmsr.c =================================================================== --- sys/arm/amlogic/aml8726/aml8726_clkmsr.c +++ sys/arm/amlogic/aml8726/aml8726_clkmsr.c @@ -255,14 +255,14 @@ * Try to access the clkmsr node directly i.e. through /aliases/. */ - if ((node = OF_finddevice("clkmsr")) != 0) + if ((node = OF_finddevice("clkmsr")) != -1) if (fdt_is_compatible_strict(node, "amlogic,aml8726-clkmsr")) goto moveon; /* * Find the node the long way. */ - if ((node = OF_finddevice("/soc")) == 0) + if ((node = OF_finddevice("/soc")) == -1) return (0); if ((node = fdt_find_compatible(node, Index: sys/arm/amlogic/aml8726/aml8726_mp.c =================================================================== --- sys/arm/amlogic/aml8726/aml8726_mp.c +++ sys/arm/amlogic/aml8726/aml8726_mp.c @@ -178,7 +178,7 @@ * Try to access the node directly i.e. through /aliases/. */ - if ((node = OF_finddevice(device)) != 0) + if ((node = OF_finddevice(device)) != -1) for (i = 0; compatible[i]; i++) if (fdt_is_compatible_strict(node, compatible[i])) return node; @@ -188,7 +188,7 @@ */ for (i = 0; compatible[i]; i++) { - if ((node = OF_finddevice("/soc")) == 0) + if ((node = OF_finddevice("/soc")) == -1) return (0); if ((node = fdt_find_compatible(node, compatible[i], 1)) != 0) Index: sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c =================================================================== --- sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c +++ sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c @@ -117,7 +117,7 @@ phandle_t node; ssize_t len; - if ((node = OF_finddevice(dwcotg_path)) == 0) + if ((node = OF_finddevice(dwcotg_path)) == -1) return (ENXIO); if (fdt_is_compatible_strict(node, "synopsys,designware-hs-otg2") == 0) Index: sys/arm/annapurna/alpine/alpine_machdep.c =================================================================== --- sys/arm/annapurna/alpine/alpine_machdep.c +++ sys/arm/annapurna/alpine/alpine_machdep.c @@ -71,7 +71,7 @@ { phandle_t node; - if ((node = OF_finddevice("/")) == 0) + if ((node = OF_finddevice("/")) == -1) return (ENXIO); if ((node = fdt_find_compatible(node, "simple-bus", 1)) == 0) Index: sys/arm/broadcom/bcm2835/bcm2835_fb.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_fb.c +++ sys/arm/broadcom/bcm2835/bcm2835_fb.c @@ -452,7 +452,7 @@ * finally go with defaults if everything else has failed. */ chosen = OF_finddevice("/chosen"); - if (chosen != 0 && + if (chosen != -1 && OF_getprop(chosen, "bootargs", &bootargs, sizeof(bootargs)) > 0) { p = bootargs; while ((v = strsep(&p, " ")) != NULL) { @@ -472,7 +472,7 @@ } root = OF_finddevice("/"); - if ((root != 0) && + if ((root != -1) && (display = fdt_find_compatible(root, "broadcom,bcm2835-fb", 1))) { if (sc->width == 0) { if ((OF_getencprop(display, "broadcom,width", Index: sys/arm/broadcom/bcm2835/bcm2835_fbd.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_fbd.c +++ sys/arm/broadcom/bcm2835/bcm2835_fbd.c @@ -223,7 +223,7 @@ /* Newer firmware versions needs an inverted color palette. */ sc->fbswap = 0; chosen = OF_finddevice("/chosen"); - if (chosen != 0 && + if (chosen != -1 && OF_getprop(chosen, "bootargs", &bootargs, sizeof(bootargs)) > 0) { p = bootargs; while ((v = strsep(&p, " ")) != NULL) { Index: sys/arm/broadcom/bcm2835/bcm2835_machdep.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_machdep.c +++ sys/arm/broadcom/bcm2835/bcm2835_machdep.c @@ -81,7 +81,7 @@ int len; system = OF_finddevice("/system"); - if (system != 0) { + if (system != -1) { len = OF_getencprop(system, "linux,serial", cells, sizeof(cells)); if (len > 0) Index: sys/arm/freescale/fsl_ocotp.c =================================================================== --- sys/arm/freescale/fsl_ocotp.c +++ sys/arm/freescale/fsl_ocotp.c @@ -72,7 +72,7 @@ phandle_t child, root; u_long base, size; - if ((root = OF_finddevice("/")) == 0) + if ((root = OF_finddevice("/")) == -1) goto fatal; if ((child = fdt_depth_search_compatible(root, "fsl,imx6q-ocotp", 0)) == 0) goto fatal; Index: sys/arm/freescale/vybrid/vf_machdep.c =================================================================== --- sys/arm/freescale/vybrid/vf_machdep.c +++ sys/arm/freescale/vybrid/vf_machdep.c @@ -68,7 +68,7 @@ goto end; src = OF_finddevice("src"); - if ((src != 0) && (OF_getencprop(src, "reg", &paddr, sizeof(paddr))) > 0) { + if ((src != -1) && (OF_getencprop(src, "reg", &paddr, sizeof(paddr))) > 0) { if (bus_space_map(fdtbus_bs_tag, paddr, 0x10, 0, &vaddr) == 0) { bus_space_write_4(fdtbus_bs_tag, vaddr, 0x00, SW_RST); } Index: sys/arm/mv/mv_common.c =================================================================== --- sys/arm/mv/mv_common.c +++ sys/arm/mv/mv_common.c @@ -2367,7 +2367,7 @@ if (ofw_bus_node_is_compatible(node, "mrvl,cesa-sram")) goto moveon; - if ((node = OF_finddevice("/")) == 0) + if ((node = OF_finddevice("/")) == -1) return (ENXIO); if ((node = fdt_find_compatible(node, "mrvl,cesa-sram", 0)) == 0) @@ -2551,7 +2551,7 @@ /* * Fix bus speed in cpu node */ - if ((sb = OF_finddevice("cpu")) != 0) + if ((sb = OF_finddevice("cpu")) != -1) if (fdt_is_compatible_strict(sb, "ARM,88VS584")) OF_setprop(sb, "bus-frequency", (void *)&freq, sizeof(freq)); Index: sys/arm/samsung/exynos/chrome_ec.c =================================================================== --- sys/arm/samsung/exynos/chrome_ec.c +++ sys/arm/samsung/exynos/chrome_ec.c @@ -225,7 +225,7 @@ /* TODO: look for compatible entry instead of hard-coded path */ arbitrator = OF_finddevice("/i2c-arbitrator"); - if (arbitrator > 0 && + if (arbitrator != -1 && OF_hasprop(arbitrator, "freebsd,our-gpio") && OF_hasprop(arbitrator, "freebsd,ec-gpio")) { sc->have_arbitrator = 1; Index: sys/arm/samsung/exynos/exynos5_ehci.c =================================================================== --- sys/arm/samsung/exynos/exynos5_ehci.c +++ sys/arm/samsung/exynos/exynos5_ehci.c @@ -240,7 +240,7 @@ reg &= ~(HOST_CTRL_RESET_LINK); bus_space_write_4(esc->host_bst, esc->host_bsh, 0x0, reg); - if ((hub = OF_finddevice("/hsichub")) != 0) { + if ((hub = OF_finddevice("/hsichub")) != -1) { reset_hsic_hub(esc, hub); } Index: sys/arm/ti/am335x/am335x_lcd.c =================================================================== --- sys/arm/ti/am335x/am335x_lcd.c +++ sys/arm/ti/am335x/am335x_lcd.c @@ -961,7 +961,7 @@ am335x_read_hdmi_property(dev); root = OF_finddevice("/"); - if (root == 0) { + if (root == -1) { device_printf(dev, "failed to get FDT root node\n"); return (ENXIO); } Index: sys/arm/ti/am335x/am335x_lcd_syscons.c =================================================================== --- sys/arm/ti/am335x/am335x_lcd_syscons.c +++ sys/arm/ti/am335x/am335x_lcd_syscons.c @@ -382,7 +382,7 @@ * to fetch data from FDT and go with defaults if failed */ root = OF_finddevice("/"); - if ((root != 0) && + if ((root != -1) && (display = am335x_syscons_find_panel_node(root))) { if ((OF_getencprop(display, "panel_width", &cell, sizeof(cell))) > 0) Index: sys/dev/fdt/fdt_common.c =================================================================== --- sys/dev/fdt/fdt_common.c +++ sys/dev/fdt/fdt_common.c @@ -215,13 +215,13 @@ /* * Try to access the SOC node directly i.e. through /aliases/. */ - if ((node = OF_finddevice("soc")) != 0) + if ((node = OF_finddevice("soc")) != -1) if (fdt_is_compatible(node, "simple-bus")) goto moveon; /* * Find the node the long way. */ - if ((node = OF_finddevice("/")) == 0) + if ((node = OF_finddevice("/")) == -1) return (ENXIO); if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0) Index: sys/dev/ofw/ofw_subr.c =================================================================== --- sys/dev/ofw/ofw_subr.c +++ sys/dev/ofw/ofw_subr.c @@ -232,7 +232,7 @@ int err; chosen = OF_finddevice("/chosen"); - if (chosen <= 0) + if (chosen == -1) return (chosen); if ((err = OF_getprop(chosen, "bootargs", buf, sizeof(buf))) != -1) { Index: sys/dev/ofw/openfirmio.c =================================================================== --- sys/dev/ofw/openfirmio.c +++ sys/dev/ofw/openfirmio.c @@ -247,7 +247,7 @@ if (error) break; node = OF_finddevice(name); - if (node == 0 || node == -1) { + if (node == -1) { error = ENOENT; break; } Index: sys/dev/ow/owc_gpiobus.c =================================================================== --- sys/dev/ow/owc_gpiobus.c +++ sys/dev/ow/owc_gpiobus.c @@ -85,7 +85,7 @@ * bus overwrites the description. */ root = OF_finddevice("/"); - if (root == 0) + if (root == -1) return; for (w1 = OF_child(root); w1 != 0; w1 = OF_peer(w1)) { if (!fdt_is_compatible_strict(w1, "w1-gpio")) Index: sys/dev/vnic/thunder_bgx_fdt.c =================================================================== --- sys/dev/vnic/thunder_bgx_fdt.c +++ sys/dev/vnic/thunder_bgx_fdt.c @@ -336,7 +336,7 @@ snprintf(bgx_sel, len + 1, "/"BGX_NODE_NAME"%d", bgx->bgx_id); /* First try the root node */ node = OF_finddevice(bgx_sel); - if ((int)node > 0) { + if (node != -1) { /* Found relevant node */ goto out; } Index: sys/powerpc/cpufreq/mpc85xx_jog.c =================================================================== --- sys/powerpc/cpufreq/mpc85xx_jog.c +++ sys/powerpc/cpufreq/mpc85xx_jog.c @@ -129,7 +129,7 @@ int i; node = OF_finddevice("/soc"); - if (node <= 0) + if (node == -1) return (NULL); for (i = 0; jog_compat[i].ocd_str != NULL; i++) Index: sys/powerpc/pseries/platform_chrp.c =================================================================== --- sys/powerpc/pseries/platform_chrp.c +++ sys/powerpc/pseries/platform_chrp.c @@ -291,7 +291,7 @@ char buf[8]; cpus = OF_finddevice("/cpus"); - if (cpus <= 0) + if (cpus == -1) panic("CPU tree not found on Open Firmware\n"); for (cpunode = OF_child(cpus); cpunode != 0; cpunode = OF_peer(cpunode)) {