From patchwork Tue Feb 22 09:57:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 579981 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 p1M9vtLv029234 for ; Tue, 22 Feb 2011 09:57:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752535Ab1BVJ5x (ORCPT ); Tue, 22 Feb 2011 04:57:53 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:58958 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095Ab1BVJ5v (ORCPT ); Tue, 22 Feb 2011 04:57:51 -0500 Received: from axis700.grange (pD9EB8B24.dip0.t-ipconnect.de [217.235.139.36]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M9vlQ-1PlFQs0Rui-00BILp; Tue, 22 Feb 2011 10:57:50 +0100 Received: by axis700.grange (Postfix, from userid 1000) id C37B8189B80; Tue, 22 Feb 2011 10:57:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id C115D189B7F; Tue, 22 Feb 2011 10:57:49 +0100 (CET) Date: Tue, 22 Feb 2011 10:57:49 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Linux Media Mailing List cc: linux-sh@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 3/3] ARM: switch mackerel to dynamically manage the platform camera In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:tDysfQV8azmlr+m5j6O+A8WLuhtLE+h+tBIBM+nUHKB YsUFEkybNrhl68hcbrYub9W3XisvhRPeYBp+IQRSPmTVRFnkMy 3aQ9Gv5/37WHNMjb3iscGwBG0q1jidRGV5dWPnTq3RGdD62Nr5 G4S/PDl9FuhAanYDmnlpcnMsk8jLrotfYM7zD9Gi7lw7mCkVGX iXOjZBysJOmA3uOHB9e6CLZCPxxc2KWY2uix8I7Y5o= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Feb 2011 09:57:55 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 7b15d21..257355e 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -843,37 +843,23 @@ static struct soc_camera_link camera_link = { .priv = &camera_info, }; -static void dummy_release(struct device *dev) +static struct platform_device *camera_device; + +static void mackerel_camera_release(struct device *dev) { + soc_camera_platform_release(&camera_device); } -static struct platform_device camera_device = { - .name = "soc_camera_platform", - .dev = { - .platform_data = &camera_info, - .release = dummy_release, - }, -}; - static int mackerel_camera_add(struct soc_camera_link *icl, struct device *dev) { - if (icl != &camera_link) - return -ENODEV; - - camera_info.dev = dev; - - return platform_device_register(&camera_device); + return soc_camera_platform_add(icl, dev, &camera_device, &camera_link, + mackerel_camera_release, 0); } static void mackerel_camera_del(struct soc_camera_link *icl) { - if (icl != &camera_link) - return; - - platform_device_unregister(&camera_device); - memset(&camera_device.dev.kobj, 0, - sizeof(camera_device.dev.kobj)); + soc_camera_platform_del(icl, camera_device, &camera_link); } static struct sh_mobile_ceu_info sh_mobile_ceu_info = {