forked from Imagelibrary/rtems
bsps/shared/ofw: Add rtems_ofw_is_node_compatible
This patch extends the RTEMS OFW API by adding rtems_ofw_find_device_by_compat This function checks if a node has the expected compatible property.
This commit is contained in:
committed by
Christian Mauderer
parent
65ab1cda10
commit
fc7129067d
@@ -690,3 +690,15 @@ phandle_t rtems_ofw_find_device_by_compat( const char *compat )
|
||||
offset = fdt_node_offset_by_compatible(fdtp, -1, compat);
|
||||
return rtems_fdt_offset_to_phandle(offset);
|
||||
}
|
||||
|
||||
bool rtems_ofw_is_node_compatible(
|
||||
phandle_t node,
|
||||
const char *compat
|
||||
)
|
||||
{
|
||||
int offset;
|
||||
|
||||
offset = rtems_fdt_phandle_to_offset(node);
|
||||
|
||||
return fdt_node_check_compatible(fdtp, offset, compat) == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user