aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/devices.c26
-rw-r--r--arch/arm/mach-omap2/gpmc.c31
2 files changed, 27 insertions, 30 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 324f02bf8a51..110256a56636 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -445,3 +445,29 @@ static int __init omap2_init_devices(void)
445 return 0; 445 return 0;
446} 446}
447omap_arch_initcall(omap2_init_devices); 447omap_arch_initcall(omap2_init_devices);
448
449static int __init omap_gpmc_init(void)
450{
451 struct omap_hwmod *oh;
452 struct platform_device *pdev;
453 char *oh_name = "gpmc";
454
455 /*
456 * if the board boots up with a populated DT, do not
457 * manually add the device from this initcall
458 */
459 if (of_have_populated_dt())
460 return -ENODEV;
461
462 oh = omap_hwmod_lookup(oh_name);
463 if (!oh) {
464 pr_err("Could not look up %s\n", oh_name);
465 return -ENODEV;
466 }
467
468 pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0);
469 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
470
471 return PTR_RET(pdev);
472}
473omap_postcore_initcall(omap_gpmc_init);
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 0753a046fed2..abfc0ddd076e 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -36,9 +36,6 @@
36#include <linux/platform_data/mtd-nand-omap2.h> 36#include <linux/platform_data/mtd-nand-omap2.h>
37#include <linux/platform_data/mtd-onenand-omap2.h> 37#include <linux/platform_data/mtd-onenand-omap2.h>
38 38
39#include "soc.h"
40#include "omap_device.h"
41
42#include <asm/mach-types.h> 39#include <asm/mach-types.h>
43 40
44#define DEVICE_NAME "omap-gpmc" 41#define DEVICE_NAME "omap-gpmc"
@@ -2009,35 +2006,9 @@ static __exit void gpmc_exit(void)
2009 2006
2010} 2007}
2011 2008
2012omap_postcore_initcall(gpmc_init); 2009postcore_initcall(gpmc_init);
2013module_exit(gpmc_exit); 2010module_exit(gpmc_exit);
2014 2011
2015static int __init omap_gpmc_init(void)
2016{
2017 struct omap_hwmod *oh;
2018 struct platform_device *pdev;
2019 char *oh_name = "gpmc";
2020
2021 /*
2022 * if the board boots up with a populated DT, do not
2023 * manually add the device from this initcall
2024 */
2025 if (of_have_populated_dt())
2026 return -ENODEV;
2027
2028 oh = omap_hwmod_lookup(oh_name);
2029 if (!oh) {
2030 pr_err("Could not look up %s\n", oh_name);
2031 return -ENODEV;
2032 }
2033
2034 pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0);
2035 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
2036
2037 return PTR_RET(pdev);
2038}
2039omap_postcore_initcall(omap_gpmc_init);
2040
2041static irqreturn_t gpmc_handle_irq(int irq, void *dev) 2012static irqreturn_t gpmc_handle_irq(int irq, void *dev)
2042{ 2013{
2043 int i; 2014 int i;