Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / devices.c
index 403c211e35d0438fe4635a32c593885faeae1a30..aef96e45cb2049c2cebba2ad50e1e8a0a8036225 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/omap4-keypad.h>
 #include <linux/wl12xx.h>
+#include <linux/platform_data/mailbox-omap.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -283,25 +284,31 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
        return 0;
 }
 
-#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
+#if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE)
 static inline void __init omap_init_mbox(void)
 {
        struct omap_hwmod *oh;
        struct platform_device *pdev;
+       struct omap_mbox_pdata *pdata;
 
        oh = omap_hwmod_lookup("mailbox");
        if (!oh) {
                pr_err("%s: unable to find hwmod\n", __func__);
                return;
        }
+       if (!oh->dev_attr) {
+               pr_err("%s: hwmod doesn't have valid attrs\n", __func__);
+               return;
+       }
 
-       pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0);
+       pdata = (struct omap_mbox_pdata *)oh->dev_attr;
+       pdev = omap_device_build("omap-mailbox", -1, oh, pdata, sizeof(*pdata));
        WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
                                                __func__, PTR_ERR(pdev));
 }
 #else
 static inline void omap_init_mbox(void) { }
-#endif /* CONFIG_OMAP_MBOX_FWK */
+#endif /* CONFIG_OMAP2PLUS_MBOX */
 
 static inline void omap_init_sti(void) {}