Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 241726
b: refs/heads/master
c: 1eed4c0
h: refs/heads/master
v: v3
  • Loading branch information
Grant Likely committed Mar 23, 2011
1 parent a855dba commit 896b4bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a52f07ecd143baee51623b063be5007585748a4f
refs/heads/master: 1eed4c077c31450bfcd0249aebb21d96fc5d5d3c
17 changes: 5 additions & 12 deletions trunk/drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ EXPORT_SYMBOL(of_platform_device_create);
/**
* of_platform_bus_create() - Create a device for a node and its children.
* @bus: device node of the bus to instantiate
* @matches: match table, NULL to use the default, OF_NO_DEEP_PROBE to
* @matches: match table for bus nodes
* disallow recursive creation of child buses
* @parent: parent for new device, or NULL for top level.
*
Expand Down Expand Up @@ -245,7 +245,7 @@ static int of_platform_bus_create(struct device_node *bus,
/**
* of_platform_bus_probe() - Probe the device-tree for platform buses
* @root: parent of the first level to probe or NULL for the root of the tree
* @matches: match table, NULL to use the default
* @matches: match table for bus nodes
* @parent: parent to hook devices from, NULL for toplevel
*
* Note that children of the provided root are not instantiated as devices
Expand All @@ -258,21 +258,14 @@ int of_platform_bus_probe(struct device_node *root,
struct device_node *child;
int rc = 0;

if (WARN_ON(!matches || matches == OF_NO_DEEP_PROBE))
return -EINVAL;
if (root == NULL)
root = of_find_node_by_path("/");
else
of_node_get(root);
if (root == NULL)
root = root ? of_node_get(root) : of_find_node_by_path("/");
if (!root)
return -EINVAL;

pr_debug("of_platform_bus_probe()\n");
pr_debug(" starting at: %s\n", root->full_name);

/* Do a self check of bus type, if there's a match, create
* children
*/
/* Do a self check of bus type, if there's a match, create children */
if (of_match_node(matches, root)) {
rc = of_platform_bus_create(root, matches, parent);
} else for_each_child_of_node(root, child) {
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/of_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
const char *bus_id,
struct device *parent);

/* pseudo "matches" value to not do deep probe */
#define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)

extern int of_platform_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent);
Expand Down

0 comments on commit 896b4bb

Please sign in to comment.