diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/memory/omap-gpmc.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 624dccb0f002..91b5a1b9b9c2 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/of_address.h> | 27 | #include <linux/of_address.h> |
| 28 | #include <linux/of_mtd.h> | 28 | #include <linux/of_mtd.h> |
| 29 | #include <linux/of_device.h> | 29 | #include <linux/of_device.h> |
| 30 | #include <linux/of_platform.h> | ||
| 30 | #include <linux/omap-gpmc.h> | 31 | #include <linux/omap-gpmc.h> |
| 31 | #include <linux/mtd/nand.h> | 32 | #include <linux/mtd/nand.h> |
| 32 | #include <linux/pm_runtime.h> | 33 | #include <linux/pm_runtime.h> |
| @@ -1812,8 +1813,21 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, | |||
| 1812 | gpmc_cs_enable_mem(cs); | 1813 | gpmc_cs_enable_mem(cs); |
| 1813 | 1814 | ||
| 1814 | no_timings: | 1815 | no_timings: |
| 1815 | if (of_platform_device_create(child, NULL, &pdev->dev)) | 1816 | |
| 1816 | return 0; | 1817 | /* create platform device, NULL on error or when disabled */ |
| 1818 | if (!of_platform_device_create(child, NULL, &pdev->dev)) | ||
| 1819 | goto err_child_fail; | ||
| 1820 | |||
| 1821 | /* is child a common bus? */ | ||
| 1822 | if (of_match_node(of_default_bus_match_table, child)) | ||
| 1823 | /* create children and other common bus children */ | ||
| 1824 | if (of_platform_populate(child, of_default_bus_match_table, | ||
| 1825 | NULL, &pdev->dev)) | ||
| 1826 | goto err_child_fail; | ||
| 1827 | |||
| 1828 | return 0; | ||
| 1829 | |||
| 1830 | err_child_fail: | ||
| 1817 | 1831 | ||
| 1818 | dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); | 1832 | dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); |
| 1819 | ret = -ENODEV; | 1833 | ret = -ENODEV; |
