Revert "of: use platform_device_add"

This reverts commit aac73f3454. 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>
This commit is contained in:
Grant Likely 2013-02-17 20:03:27 +00:00
Родитель e570d7c15a
Коммит 02bbde7849
1 изменённых файлов: 2 добавлений и 11 удалений

Просмотреть файл

@ -203,7 +203,6 @@ struct platform_device *of_platform_device_create_pdata(
struct device *parent) struct device *parent)
{ {
struct platform_device *dev; struct platform_device *dev;
int rc;
if (!of_device_is_available(np)) if (!of_device_is_available(np))
return NULL; return NULL;
@ -215,24 +214,16 @@ struct platform_device *of_platform_device_create_pdata(
#if defined(CONFIG_MICROBLAZE) #if defined(CONFIG_MICROBLAZE)
dev->archdata.dma_mask = 0xffffffffUL; dev->archdata.dma_mask = 0xffffffffUL;
#endif #endif
dev->name = dev_name(&dev->dev);
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
dev->dev.bus = &platform_bus_type;
dev->dev.platform_data = platform_data; dev->dev.platform_data = platform_data;
dev->dev.id = PLATFORM_DEVID_NONE;
/* device_add will assume that this device is on the same node as
* the parent. If there is no parent defined, set the node
* explicitly */
if (!parent)
set_dev_node(&dev->dev, of_node_to_nid(np));
/* We do not fill the DMA ops for platform devices by default. /* We do not fill the DMA ops for platform devices by default.
* This is currently the responsibility of the platform code * This is currently the responsibility of the platform code
* to do such, possibly using a device notifier * to do such, possibly using a device notifier
*/ */
rc = platform_device_add(dev); if (of_device_add(dev) != 0) {
if (rc) {
dev_err(&dev->dev, "device registration failed\n");
platform_device_put(dev); platform_device_put(dev);
return NULL; return NULL;
} }