@@ -41,11 +41,8 @@ static struct iommu_device devices[] = {
},
},
};
-#define NR_IOMMU_DEVICES ARRAY_SIZE(omap3_iommu_pdata)
-static struct platform_device *omap3_iommu_pdev[NR_IOMMU_DEVICES];
-
-static struct platform_device *omap_iommu_add(const char *name)
+struct platform_device *omap_iommu_add(const char *name)
{
struct platform_device *pdev;
const struct iommu_device *d = NULL;
@@ -91,36 +88,7 @@ err_out:
platform_device_put(pdev);
return NULL;
}
-
-static int __init omap3_iommu_init(void)
-{
- struct platform_device *pdev;
- int i, err;
-
- for (i = 0; i < ARRAY_SIZE(devices); i++) {
- pdev = omap_iommu_add(devices[i].pdata.name);
- if (!pdev)
- goto err_out;
- omap3_iommu_pdev[i] = pdev;
- }
-
- return 0;
-
-err_out:
- while (i--)
- platform_device_put(omap3_iommu_pdev[i]);
- return err;
-}
-module_init(omap3_iommu_init);
-
-static void __exit omap3_iommu_exit(void)
-{
- int i;
-
- for (i = 0; i < NR_IOMMU_DEVICES; i++)
- platform_device_unregister(omap3_iommu_pdev[i]);
-}
-module_exit(omap3_iommu_exit);
+EXPORT_SYMBOL_GPL(omap_iommu_add);
MODULE_AUTHOR("Hiroshi DOYU");
MODULE_DESCRIPTION("omap iommu: omap3 device registration");
@@ -165,4 +165,6 @@ extern int foreach_iommu_device(void *data,
extern ssize_t iommu_dump_ctx(struct iommu *obj, char *buf);
extern size_t dump_tlb_entries(struct iommu *obj, char *buf);
+struct platform_device *omap_iommu_add(const char *name);
+
#endif /* __MACH_IOMMU_H */
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- arch/arm/mach-omap2/omap3-iommu.c | 36 +----------------------------- arch/arm/plat-omap/include/mach/iommu.h | 2 + 2 files changed, 4 insertions(+), 34 deletions(-)