]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: OMAP: Move omap_mmc_add() to mach-omap1
authorTony Lindgren <tony@atomide.com>
Mon, 23 Apr 2012 22:56:36 +0000 (15:56 -0700)
committerTony Lindgren <tony@atomide.com>
Wed, 9 May 2012 23:35:12 +0000 (16:35 -0700)
Now that omap2420 is using hwmod for MMC, this code is omap1
only used on omap1.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/devices.c
arch/arm/plat-omap/devices.c
arch/arm/plat-omap/include/plat/mmc.h

index b853f6110a440794f660fb50c84a0d3a5397a321..21926765b16d12902003cbfce7bef225bd46ca3f 100644 (file)
@@ -144,6 +144,49 @@ static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
        }
 }
 
+#define OMAP_MMC_NR_RES                2
+
+/*
+ * Register MMC devices.
+ */
+static int __init omap_mmc_add(const char *name, int id, unsigned long base,
+                               unsigned long size, unsigned int irq,
+                               struct omap_mmc_platform_data *data)
+{
+       struct platform_device *pdev;
+       struct resource res[OMAP_MMC_NR_RES];
+       int ret;
+
+       pdev = platform_device_alloc(name, id);
+       if (!pdev)
+               return -ENOMEM;
+
+       memset(res, 0, OMAP_MMC_NR_RES * sizeof(struct resource));
+       res[0].start = base;
+       res[0].end = base + size - 1;
+       res[0].flags = IORESOURCE_MEM;
+       res[1].start = res[1].end = irq;
+       res[1].flags = IORESOURCE_IRQ;
+
+       ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
+       if (ret == 0)
+               ret = platform_device_add_data(pdev, data, sizeof(*data));
+       if (ret)
+               goto fail;
+
+       ret = platform_device_add(pdev);
+       if (ret)
+               goto fail;
+
+       /* return device handle to board setup code */
+       data->dev = &pdev->dev;
+       return 0;
+
+fail:
+       platform_device_put(pdev);
+       return ret;
+}
+
 void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
                        int nr_controllers)
 {
index 1151d0b11c914bf5a4c20ba6132efb4db4383e20..1cba9273d2cb4ff68832937b2e450a140020e6ca 100644 (file)
 #include <plat/menelaus.h>
 #include <plat/omap44xx.h>
 
-#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
-       defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
-
-#define OMAP_MMC_NR_RES                2
-
-/*
- * Register MMC devices. Called from mach-omap1 and mach-omap2 device init.
- */
-int __init omap_mmc_add(const char *name, int id, unsigned long base,
-                               unsigned long size, unsigned int irq,
-                               struct omap_mmc_platform_data *data)
-{
-       struct platform_device *pdev;
-       struct resource res[OMAP_MMC_NR_RES];
-       int ret;
-
-       pdev = platform_device_alloc(name, id);
-       if (!pdev)
-               return -ENOMEM;
-
-       memset(res, 0, OMAP_MMC_NR_RES * sizeof(struct resource));
-       res[0].start = base;
-       res[0].end = base + size - 1;
-       res[0].flags = IORESOURCE_MEM;
-       res[1].start = res[1].end = irq;
-       res[1].flags = IORESOURCE_IRQ;
-
-       ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
-       if (ret == 0)
-               ret = platform_device_add_data(pdev, data, sizeof(*data));
-       if (ret)
-               goto fail;
-
-       ret = platform_device_add(pdev);
-       if (ret)
-               goto fail;
-
-       /* return device handle to board setup code */
-       data->dev = &pdev->dev;
-       return 0;
-
-fail:
-       platform_device_put(pdev);
-       return ret;
-}
-
-#endif
-
 /*-------------------------------------------------------------------------*/
 
 #if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE)
index 3e7ae0f0215feeeb130d292bd1c5c828ab2729af..a7754a886d428af5599c00c4fefdcb4d2d058d12 100644 (file)
@@ -177,9 +177,6 @@ extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
 void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
                                int nr_controllers);
 void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
-int omap_mmc_add(const char *name, int id, unsigned long base,
-                               unsigned long size, unsigned int irq,
-                               struct omap_mmc_platform_data *data);
 #else
 static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
                                int nr_controllers)
@@ -188,12 +185,6 @@ static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
 static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
 {
 }
-static inline int omap_mmc_add(const char *name, int id, unsigned long base,
-                               unsigned long size, unsigned int irq,
-                               struct omap_mmc_platform_data *data)
-{
-       return 0;
-}
 
 #endif