All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-omap@vger.kernel.org
Cc: sakari.ailus@maxwell.research.nokia.com
Subject: [RFC/PATCH v3 6/7] omap3: Export omap3isp platform device structure
Date: Thu, 25 Nov 2010 03:54:37 +0100	[thread overview]
Message-ID: <1290653678-15556-7-git-send-email-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <1290653678-15556-1-git-send-email-laurent.pinchart@ideasonboard.com>

From: Stanimir Varbanov <svarbanov@mm-sol.com>

The omap3isp platform device requires platform data. As the data can be
provided by a kernel module, the device can't be registered during arch
initialization.

Remove the omap3isp platform device registration from
omap_init_camera(), and export the platform device structure to let
board code register/unregister it.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-omap2/devices.c |   18 ++++++++++++++++--
 arch/arm/mach-omap2/devices.h |   17 +++++++++++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/devices.h

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index d5da345..c2275d3 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -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)
diff --git a/arch/arm/mach-omap2/devices.h b/arch/arm/mach-omap2/devices.h
new file mode 100644
index 0000000..f312d49
--- /dev/null
+++ b/arch/arm/mach-omap2/devices.h
@@ -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
-- 
1.7.2.2


  parent reply	other threads:[~2010-11-25  2:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25  2:54 [RFC/PATCH v3 0/7] OMAP3 ISP driver Laurent Pinchart
2010-11-25  2:54 ` [RFC/PATCH v3 1/7] v4l: subdev: Generic ioctl support Laurent Pinchart
2010-11-25  2:54 ` [RFC/PATCH v3 2/7] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions Laurent Pinchart
2010-11-25  2:54 ` [RFC/PATCH v3 3/7] v4l: Add subdev sensor g_skip_frames operation Laurent Pinchart
2010-11-25  2:54 ` [RFC/PATCH v3 4/7] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h Laurent Pinchart
2010-11-25  2:54 ` [RFC/PATCH v3 5/7] ARM: OMAP3: Update Camera ISP definitions for OMAP3630 Laurent Pinchart
2010-12-06 19:30   ` Tony Lindgren
2010-11-25  2:54 ` Laurent Pinchart [this message]
2010-11-25  7:02   ` [RFC/PATCH v3 6/7] omap3: Export omap3isp platform device structure Felipe Balbi
2010-11-25 11:17     ` Laurent Pinchart
2010-11-25 11:23       ` Felipe Balbi
2010-12-06 19:32         ` Tony Lindgren
2010-12-10  1:12           ` Laurent Pinchart
2010-11-25  7:03   ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290653678-15556-7-git-send-email-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=sakari.ailus@maxwell.research.nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.