mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 00:34:07 +08:00
@@ -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);
|
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,
|
struct device_node *of_find_compatible_node(struct device_node *dns,
|
||||||
const struct device_node *dn, const char *type, const char *compatible);
|
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);
|
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 *
|
struct device_node *
|
||||||
of_find_compatible_node(struct device_node *dns, const struct device_node *dn,
|
of_find_compatible_node(struct device_node *dns, const struct device_node *dn,
|
||||||
const char *type, const char *compatible)
|
const char *type, const char *compatible)
|
||||||
|
Reference in New Issue
Block a user