@@ -34,6 +34,8 @@
#include "mux.h"
#include "control.h"
+#include "devices.h"
+
#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
static struct resource cam_resources[] = {
@@ -144,16 +146,28 @@ static struct resource omap3isp_resources[] = {
}
};
-static struct platform_device omap3isp_device = {
+static void omap3isp_release(struct device *dev)
+{
+ /* Zero the device structure to avoid re-initialization complaints from
+ * kobject when the device will be re-registered.
+ */
+ memset(dev, 0, sizeof(*dev));
+ dev->release = omap3isp_release;
+}
+
+struct platform_device omap3isp_device = {
.name = "omap3isp",
.id = -1,
.num_resources = ARRAY_SIZE(omap3isp_resources),
.resource = omap3isp_resources,
+ .dev = {
+ .release = omap3isp_release,
+ },
};
+EXPORT_SYMBOL_GPL(omap3isp_device);
static inline void omap_init_camera(void)
{
- platform_device_register(&omap3isp_device);
}
#else
static inline void omap_init_camera(void)
new file mode 100644
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/mach-omap2/devices.h
+ *
+ * OMAP2 platform device setup/initialization
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP_DEVICES_H
+#define __ARCH_ARM_MACH_OMAP_DEVICES_H
+
+extern struct platform_device omap3isp_device;
+
+#endif