of: move of_find_device_by_node_path to drivers/of/of_path.c
As it's generic helper function which should not stay in driver specific code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
601dcf7644
commit
12c7f5d560
|
@ -34,20 +34,6 @@ struct of_partition {
|
|||
|
||||
static LIST_HEAD(of_partition_list);
|
||||
|
||||
struct device_d *of_find_device_by_node_path(const char *path)
|
||||
{
|
||||
struct device_d *dev;
|
||||
|
||||
for_each_device(dev) {
|
||||
if (!dev->device_node)
|
||||
continue;
|
||||
if (!strcmp(path, dev->device_node->full_name))
|
||||
return dev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int environment_probe(struct device_d *dev)
|
||||
{
|
||||
char *path;
|
||||
|
|
|
@ -31,6 +31,20 @@ struct of_path_type {
|
|||
int (*parse)(struct of_path *op, const char *str);
|
||||
};
|
||||
|
||||
struct device_d *of_find_device_by_node_path(const char *path)
|
||||
{
|
||||
struct device_d *dev;
|
||||
|
||||
for_each_device(dev) {
|
||||
if (!dev->device_node)
|
||||
continue;
|
||||
if (!strcmp(path, dev->device_node->full_name))
|
||||
return dev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* of_path_type_partname - find a partition based on physical device and
|
||||
* partition name
|
||||
|
|
Loading…
Reference in New Issue