mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
of: merge machine_is_compatible()
Merge common code between PowerPC and Microblaze Signed-off-by: Grant Likely <[email protected]> Tested-by: Wolfram Sang <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]>
This commit is contained in:
parent
86e0322134
commit
1f43cfb947
3 changed files with 21 additions and 37 deletions
|
|
@ -143,6 +143,27 @@ int of_device_is_compatible(const struct device_node *device,
|
|||
}
|
||||
EXPORT_SYMBOL(of_device_is_compatible);
|
||||
|
||||
/**
|
||||
* machine_is_compatible - Test root of device tree for a given compatible value
|
||||
* @compat: compatible string to look for in root node's compatible property.
|
||||
*
|
||||
* Returns true if the root node has the given value in its
|
||||
* compatible property.
|
||||
*/
|
||||
int machine_is_compatible(const char *compat)
|
||||
{
|
||||
struct device_node *root;
|
||||
int rc = 0;
|
||||
|
||||
root = of_find_node_by_path("/");
|
||||
if (root) {
|
||||
rc = of_device_is_compatible(root, compat);
|
||||
of_node_put(root);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL(machine_is_compatible);
|
||||
|
||||
/**
|
||||
* of_device_is_available - check if a device is available for use
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue