]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm/mach-omap2/devices.c
ARM: OMAP2+: devices: Do not print error when DMIC hwmod lookup fails
[karo-tx-linux.git] / arch / arm / mach-omap2 / devices.c
index 1ec7f05977102759383f05351469baeecbd3e856..8f268b4f443fe4f86de0d8e456ad37cb3caca908 100644 (file)
@@ -374,10 +374,8 @@ static void __init omap_init_mcpdm(void)
        struct platform_device *pdev;
 
        oh = omap_hwmod_lookup("mcpdm");
-       if (!oh) {
-               printk(KERN_ERR "Could not look up mcpdm hw_mod\n");
+       if (!oh)
                return;
-       }
 
        pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0);
        WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n");
@@ -395,10 +393,8 @@ static void __init omap_init_dmic(void)
        struct platform_device *pdev;
 
        oh = omap_hwmod_lookup("dmic");
-       if (!oh) {
-               pr_err("Could not look up dmic hw_mod\n");
+       if (!oh)
                return;
-       }
 
        pdev = omap_device_build("omap-dmic", -1, oh, NULL, 0);
        WARN(IS_ERR(pdev), "Can't build omap_device for omap-dmic.\n");
@@ -504,140 +500,31 @@ static void omap_init_rng(void)
        WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
 }
 
-#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
-
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap2_sham_resources[] = {
-       {
-               .start  = OMAP24XX_SEC_SHA1MD5_BASE,
-               .end    = OMAP24XX_SEC_SHA1MD5_BASE + 0x64,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = 51 + OMAP_INTC_START,
-               .flags  = IORESOURCE_IRQ,
-       }
-};
-static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources);
-#else
-#define omap2_sham_resources           NULL
-#define omap2_sham_resources_sz                0
-#endif
-
-#ifdef CONFIG_ARCH_OMAP3
-static struct resource omap3_sham_resources[] = {
-       {
-               .start  = OMAP34XX_SEC_SHA1MD5_BASE,
-               .end    = OMAP34XX_SEC_SHA1MD5_BASE + 0x64,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = 49 + OMAP_INTC_START,
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = OMAP34XX_DMA_SHA1MD5_RX,
-               .flags  = IORESOURCE_DMA,
-       }
-};
-static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources);
-#else
-#define omap3_sham_resources           NULL
-#define omap3_sham_resources_sz                0
-#endif
-
-static struct platform_device sham_device = {
-       .name           = "omap-sham",
-       .id             = -1,
-};
-
-static void omap_init_sham(void)
+static void __init omap_init_sham(void)
 {
-       if (cpu_is_omap24xx()) {
-               sham_device.resource = omap2_sham_resources;
-               sham_device.num_resources = omap2_sham_resources_sz;
-       } else if (cpu_is_omap34xx()) {
-               sham_device.resource = omap3_sham_resources;
-               sham_device.num_resources = omap3_sham_resources_sz;
-       } else {
-               pr_err("%s: platform not supported\n", __func__);
-               return;
-       }
-       platform_device_register(&sham_device);
-}
-#else
-static inline void omap_init_sham(void) { }
-#endif
-
-#if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)
-
-#ifdef CONFIG_ARCH_OMAP2
-static struct resource omap2_aes_resources[] = {
-       {
-               .start  = OMAP24XX_SEC_AES_BASE,
-               .end    = OMAP24XX_SEC_AES_BASE + 0x4C,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = OMAP24XX_DMA_AES_TX,
-               .flags  = IORESOURCE_DMA,
-       },
-       {
-               .start  = OMAP24XX_DMA_AES_RX,
-               .flags  = IORESOURCE_DMA,
-       }
-};
-static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
-#else
-#define omap2_aes_resources            NULL
-#define omap2_aes_resources_sz         0
-#endif
+       struct omap_hwmod *oh;
+       struct platform_device *pdev;
 
-#ifdef CONFIG_ARCH_OMAP3
-static struct resource omap3_aes_resources[] = {
-       {
-               .start  = OMAP34XX_SEC_AES_BASE,
-               .end    = OMAP34XX_SEC_AES_BASE + 0x4C,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = OMAP34XX_DMA_AES2_TX,
-               .flags  = IORESOURCE_DMA,
-       },
-       {
-               .start  = OMAP34XX_DMA_AES2_RX,
-               .flags  = IORESOURCE_DMA,
-       }
-};
-static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources);
-#else
-#define omap3_aes_resources            NULL
-#define omap3_aes_resources_sz         0
-#endif
+       oh = omap_hwmod_lookup("sham");
+       if (!oh)
+               return;
 
-static struct platform_device aes_device = {
-       .name           = "omap-aes",
-       .id             = -1,
-};
+       pdev = omap_device_build("omap-sham", -1, oh, NULL, 0);
+       WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n");
+}
 
-static void omap_init_aes(void)
+static void __init omap_init_aes(void)
 {
-       if (cpu_is_omap24xx()) {
-               aes_device.resource = omap2_aes_resources;
-               aes_device.num_resources = omap2_aes_resources_sz;
-       } else if (cpu_is_omap34xx()) {
-               aes_device.resource = omap3_aes_resources;
-               aes_device.num_resources = omap3_aes_resources_sz;
-       } else {
-               pr_err("%s: platform not supported\n", __func__);
+       struct omap_hwmod *oh;
+       struct platform_device *pdev;
+
+       oh = omap_hwmod_lookup("aes");
+       if (!oh)
                return;
-       }
-       platform_device_register(&aes_device);
-}
 
-#else
-static inline void omap_init_aes(void) { }
-#endif
+       pdev = omap_device_build("omap-aes", -1, oh, NULL, 0);
+       WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n");
+}
 
 /*-------------------------------------------------------------------------*/
 
@@ -764,11 +651,11 @@ static int __init omap2_init_devices(void)
                omap_init_dmic();
                omap_init_mcpdm();
                omap_init_mcspi();
+               omap_init_sham();
+               omap_init_aes();
        }
        omap_init_sti();
        omap_init_rng();
-       omap_init_sham();
-       omap_init_aes();
        omap_init_vout();
        omap_init_ocp2scp();