mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Consolidate of_get_parent
This requires creating dummy of_node_{get,put} routines for sparc and
sparc64. It also adds a read_lock around the parent accesses.
Signed-off-by: Stephen Rothwell <[email protected]>
Acked-by: Paul Mackerras <[email protected]>
Acked-by: David S. Miller <[email protected]>
This commit is contained in:
parent
581b605a83
commit
e679c5f445
6 changed files with 39 additions and 47 deletions
|
|
@ -113,3 +113,24 @@ int of_device_is_compatible(const struct device_node *device,
|
|||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(of_device_is_compatible);
|
||||
|
||||
/**
|
||||
* of_get_parent - Get a node's parent if any
|
||||
* @node: Node to get parent
|
||||
*
|
||||
* Returns a node pointer with refcount incremented, use
|
||||
* of_node_put() on it when done.
|
||||
*/
|
||||
struct device_node *of_get_parent(const struct device_node *node)
|
||||
{
|
||||
struct device_node *np;
|
||||
|
||||
if (!node)
|
||||
return NULL;
|
||||
|
||||
read_lock(&devtree_lock);
|
||||
np = of_node_get(node->parent);
|
||||
read_unlock(&devtree_lock);
|
||||
return np;
|
||||
}
|
||||
EXPORT_SYMBOL(of_get_parent);
|
||||
|
|
|
|||
Loading…
Reference in a new issue