From patchwork Thu Nov 25 02:54:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 355902 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAP2sbRo029564 for ; Thu, 25 Nov 2010 02:54:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932124Ab0KYCyg (ORCPT ); Wed, 24 Nov 2010 21:54:36 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:53703 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932109Ab0KYCyf (ORCPT ); Wed, 24 Nov 2010 21:54:35 -0500 Received: from localhost.localdomain (unknown [91.178.68.191]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 60A0A35CD7; Thu, 25 Nov 2010 02:54:34 +0000 (UTC) From: Laurent Pinchart 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 Message-Id: <1290653678-15556-7-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: <1290653678-15556-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1290653678-15556-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 25 Nov 2010 02:54:37 +0000 (UTC) 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