GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OF_FINDDEVICE(9) FreeBSD Kernel Developer's Manual OF_FINDDEVICE(9)

OF_finddevice
find node in device tree

#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>

phandle_t
OF_finddevice(const char *path);

OF_finddevice() returns the phandle for the node specified by the path. Returns -1 if the path cannot be found in the tree.

    phandle_t root, i2c;

    root = OF_finddevice("/");
    i2c = OF_finddevice("/soc/axi/i2c@a0e0000");
    if (i2c != -1) {
        ...
    }

OF_child(9) OF_parent(9) OF_peer(9)

This manual page was written by Oleksandr Tymoshenko <gonzo@FreeBSD.org>.

The return value should only be checked with equality operators (equal to, not equal to) and not relational comparison (less than, greater than ). There is a discrepancy between IEEE 1275 standard and FreeBSD's internal representation of a phandle: IEEE 1275 requires the return value of this function to be -1 if the path is not found. But phandle_t is an unsigned type, so it cannot be relationally compared with -1 or 0, this comparison is always true or always false.
April 9, 2018 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 9 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.