diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-24 16:58:34 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-26 18:48:06 -0500 |
commit | 964dba283439a4db50dae61d3afe6e438b7fc30f (patch) | |
tree | df23cd3d6032187d46093512aaf3772aeffb8c76 /include/linux/of_platform.h | |
parent | d593f25ff263b1a7752b7380f8b7d57809206c40 (diff) |
devicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc)
Sparc has its own helpers for translating address ranges when the device
tree is parsed at boot time, and it isn't able to use of_platform_populate().
However, there are some device drivers that want to use that function on
other DT enabled platforms (ie. TWL4030). This patch adds an empty
of_platform_populate() implementation that returns an error when
CONFIG_OF_ADDRESS is not selected.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/of_platform.h')
-rw-r--r-- | include/linux/of_platform.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 040ce2f6e8de..242fa3563e2e 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -81,7 +81,7 @@ extern struct platform_device *of_device_alloc(struct device_node *np, | |||
81 | struct device *parent); | 81 | struct device *parent); |
82 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | 82 | extern struct platform_device *of_find_device_by_node(struct device_node *np); |
83 | 83 | ||
84 | #if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ | 84 | #ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ |
85 | /* Platform devices and busses creation */ | 85 | /* Platform devices and busses creation */ |
86 | extern struct platform_device *of_platform_device_create(struct device_node *np, | 86 | extern struct platform_device *of_platform_device_create(struct device_node *np, |
87 | const char *bus_id, | 87 | const char *bus_id, |
@@ -94,7 +94,15 @@ extern int of_platform_populate(struct device_node *root, | |||
94 | const struct of_device_id *matches, | 94 | const struct of_device_id *matches, |
95 | const struct of_dev_auxdata *lookup, | 95 | const struct of_dev_auxdata *lookup, |
96 | struct device *parent); | 96 | struct device *parent); |
97 | #endif /* !CONFIG_SPARC */ | 97 | #else |
98 | static inline int of_platform_populate(struct device_node *root, | ||
99 | const struct of_device_id *matches, | ||
100 | const struct of_dev_auxdata *lookup, | ||
101 | struct device *parent) | ||
102 | { | ||
103 | return -ENODEV; | ||
104 | } | ||
105 | #endif /* !CONFIG_OF_ADDRESS */ | ||
98 | 106 | ||
99 | #endif /* CONFIG_OF_DEVICE */ | 107 | #endif /* CONFIG_OF_DEVICE */ |
100 | 108 | ||