ofw_bus_status_okay(9)
β¨ ofw_bus_status_okay(9) β the device tree vibe check π
okay so bestie, welcome to the ofw_bus_status_okay corner of the Kernel Developer's Manual. we're talking about checking the status of a device tree node, and honestly? it's giving "is this device even invited to the party" energy π
β¨ SYNOPSIS β¨
first things first, the includes you gotta have, no cap:
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
then the three iconic functions themselves:
const char *
ofw_bus_get_status(device_t dev);
int
ofw_bus_status_okay(device_t dev);
int
ofw_bus_node_status_okay(phandle_t node);
πΈ DESCRIPTION πΈ
so the "status" property of a device tree node is literally the thing that tells you whether the device is enabled or not, periodt. here's the tea: multiple hardware versions might be built using the same base System-on-Chip but with a different set of blocks enabled. it's super common to use one SoC device tree and only enable/disable device nodes for the derivative boards π§
a device tree node is considered enabled only if it has that "status" property with the value set to either "ok" or "okay" β those are the only two values that slay π
okay now the three besties one by one:
ofw_bus_get_status()returns the value of the"status"property of the device tree node associated with the device dev. but lowkey important: if the node does not have a"status"property, or there's no node associated with the device at all, the function returnsNULL. πofw_bus_status_okay()returns1if the device tree node associated with the device dev has a"status"property and its value is either"ok"or"okay".ofw_bus_node_status_okay()returns1if the device tree node node has a"status"property and its value is either"ok"or"okay".
note the difference bestie:ofw_bus_status_okay()takes adevice_tand looks up its node, whileofw_bus_node_status_okay()takes thephandle_tnode directly. same vibe check, different starting point π¦
π AUTHORS π
this manual page was written by Oleksandr Tymoshenko. absolute icon, we stan π«Ά
and that's the whole thing, bestie! this page came from the Debian manual set, dated April 8, 2018, and it's filed under ofw_bus_status_okay(9) in the Kernel Developer's Manual. go check your status property, stay "okay", and slay β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2018 Oleksandr Tymoshenko
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms