Skip to content

Commit

Permalink
dt: Add default match table for bus ids
Browse files Browse the repository at this point in the history
No need for most platforms to define their own bus table when calling
of_platform_populate().  Supply a stock one.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Grant Likely committed Jun 21, 2011
1 parent 5629937 commit cbb49c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
#include <linux/of_platform.h>
#include <linux/platform_device.h>

const struct of_device_id of_default_bus_match_table[] = {
{ .compatible = "simple-bus", },
#ifdef CONFIG_ARM_AMBA
{ .compatible = "arm,amba-bus", },
#endif /* CONFIG_ARM_AMBA */
{} /* Empty terminated list */
};

static int of_dev_node_match(struct device *dev, void *data)
{
return dev->of_node == data;
Expand Down
2 changes: 2 additions & 0 deletions include/linux/of_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ struct of_platform_driver
#define to_of_platform_driver(drv) \
container_of(drv,struct of_platform_driver, driver)

extern const struct of_device_id of_default_bus_match_table[];

/* Platform drivers register/unregister */
extern struct platform_device *of_device_alloc(struct device_node *np,
const char *bus_id,
Expand Down

0 comments on commit cbb49c2

Please sign in to comment.