aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2013-02-17 15:03:27 -0500
committerGrant Likely <grant.likely@secretlab.ca>2013-02-17 15:03:27 -0500
commit02bbde7849e68e193cefaa1885fe0df0f03c9fcd (patch)
tree788a1d2226a1aa3a8bbcf58dfe9739f869ea7be0 /drivers/of
parente570d7c15a73f88942885881a84257a65fa44c80 (diff)
Revert "of: use platform_device_add"
This reverts commit aac73f34542bc7ae4317928d2eabfeb21d247323. That commit causes two kinds of breakage; it breaks registration of AMBA devices when one of the parent nodes already contains overlapping resource regions, and it breaks calls to request_region() by device drivers in certain conditions where there are overlapping memory regions. Both of these problems can probably be fixed, but it is better to back out the commit and get a proper fix designed before trying again. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/platform.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 3c3e3cad3e08..b80891b43816 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -203,7 +203,6 @@ struct platform_device *of_platform_device_create_pdata(
203 struct device *parent) 203 struct device *parent)
204{ 204{
205 struct platform_device *dev; 205 struct platform_device *dev;
206 int rc;
207 206
208 if (!of_device_is_available(np)) 207 if (!of_device_is_available(np))
209 return NULL; 208 return NULL;
@@ -215,24 +214,16 @@ struct platform_device *of_platform_device_create_pdata(
215#if defined(CONFIG_MICROBLAZE) 214#if defined(CONFIG_MICROBLAZE)
216 dev->archdata.dma_mask = 0xffffffffUL; 215 dev->archdata.dma_mask = 0xffffffffUL;
217#endif 216#endif
218 dev->name = dev_name(&dev->dev);
219 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 217 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
218 dev->dev.bus = &platform_bus_type;
220 dev->dev.platform_data = platform_data; 219 dev->dev.platform_data = platform_data;
221 dev->dev.id = PLATFORM_DEVID_NONE;
222 /* device_add will assume that this device is on the same node as
223 * the parent. If there is no parent defined, set the node
224 * explicitly */
225 if (!parent)
226 set_dev_node(&dev->dev, of_node_to_nid(np));
227 220
228 /* We do not fill the DMA ops for platform devices by default. 221 /* We do not fill the DMA ops for platform devices by default.
229 * This is currently the responsibility of the platform code 222 * This is currently the responsibility of the platform code
230 * to do such, possibly using a device notifier 223 * to do such, possibly using a device notifier
231 */ 224 */
232 225
233 rc = platform_device_add(dev); 226 if (of_device_add(dev) != 0) {
234 if (rc) {
235 dev_err(&dev->dev, "device registration failed\n");
236 platform_device_put(dev); 227 platform_device_put(dev);
237 return NULL; 228 return NULL;
238 } 229 }