Merge branch 'for-next/of'
This commit is contained in:
commit
9bb76883c1
|
@ -35,20 +35,6 @@ struct of_partition {
|
||||||
|
|
||||||
static LIST_HEAD(of_partition_list);
|
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)
|
static int environment_probe(struct device_d *dev)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path;
|
||||||
|
|
|
@ -31,6 +31,20 @@ struct of_path_type {
|
||||||
int (*parse)(struct of_path *op, const char *str);
|
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
|
* of_path_type_partname - find a partition based on physical device and
|
||||||
* partition name
|
* partition name
|
||||||
|
@ -134,6 +148,9 @@ int of_find_path(struct device_node *node, const char *propname, char **outpath)
|
||||||
|
|
||||||
device_detect(op.dev);
|
device_detect(op.dev);
|
||||||
|
|
||||||
|
if (list_is_singular(&op.dev->cdevs))
|
||||||
|
op.cdev = list_first_entry(&op.dev->cdevs, struct cdev, devices_list);
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -60,6 +60,8 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node)
|
||||||
filename = asprintf("%s.%s", cdev->name, partname);
|
filename = asprintf("%s.%s", cdev->name, partname);
|
||||||
|
|
||||||
new = devfs_add_partition(cdev->name, offset, size, flags, filename);
|
new = devfs_add_partition(cdev->name, offset, size, flags, filename);
|
||||||
|
if (new && new->dev)
|
||||||
|
new->dev->device_node = node;
|
||||||
|
|
||||||
free(filename);
|
free(filename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue