mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-06-02 04:33:03 +08:00
parent
44fca38058
commit
81fc57de35
@ -88,6 +88,9 @@ bool of_device_is_available(const struct device_node *dn);
|
||||
|
||||
int of_device_is_compatible(const struct device_node *dn, const char *name);
|
||||
|
||||
struct device_node *of_find_node_by_path(struct device_node *dns,
|
||||
const char *path);
|
||||
|
||||
struct device_node *of_find_compatible_node(struct device_node *dns,
|
||||
const struct device_node *dn, const char *type, const char *compatible);
|
||||
|
||||
|
@ -89,6 +89,22 @@ of_device_is_compatible(const struct device_node *dn, const char *name)
|
||||
return (fdt_node_check_compatible(fdt, dn->offset, name) == 0);
|
||||
}
|
||||
|
||||
struct device_node *
|
||||
of_find_node_by_path(struct device_node *dns, const char *path)
|
||||
{
|
||||
const void *fdt = bsp_fdt_get();
|
||||
int node;
|
||||
|
||||
memset(dns, 0, sizeof(*dns));
|
||||
|
||||
node = fdt_path_offset(fdt, path);
|
||||
if (node < 0)
|
||||
return (NULL);
|
||||
|
||||
dns->offset = node;
|
||||
return (dns);
|
||||
}
|
||||
|
||||
struct device_node *
|
||||
of_find_compatible_node(struct device_node *dns, const struct device_node *dn,
|
||||
const char *type, const char *compatible)
|
||||
|
Loading…
x
Reference in New Issue
Block a user