From patchwork Fri May 15 17:20:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 24140 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4FHIkij031122 for ; Fri, 15 May 2009 17:19:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754337AbZEORTt (ORCPT ); Fri, 15 May 2009 13:19:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754512AbZEORTt (ORCPT ); Fri, 15 May 2009 13:19:49 -0400 Received: from mail.gmx.net ([213.165.64.20]:46442 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754337AbZEORTs (ORCPT ); Fri, 15 May 2009 13:19:48 -0400 Received: (qmail invoked by alias); 15 May 2009 17:19:48 -0000 Received: from p57BD0961.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.9.97] by mail.gmx.net (mp054) with SMTP; 15 May 2009 19:19:48 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1+jjORAo3CjNNsJ7t0k9K8poAY+s7dyBbjC3QnsAb lXGXBd6HFr25MH Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1M514j-0002ZS-Pb; Fri, 15 May 2009 19:20:01 +0200 Date: Fri, 15 May 2009 19:20:01 +0200 (CEST) From: Guennadi Liakhovetski To: Linux Media Mailing List cc: Hans Verkuil , Magnus Damm , Robert Jarzmik , Darius Augulis , Paul Mundt Subject: [PATCH 07/10 v2] sh: prepare board-ap325rxa.c for v4l2-subdev conversion In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.51 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We will be registering and unregistering the soc_camera_platform platform device multiple times, therefore we need a .release() method and have to nullify the kobj. Signed-off-by: Guennadi Liakhovetski --- Another one for "sh". Again have to synchronise. arch/sh/boards/board-ap325rxa.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index f644ad7..9329fe5 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c @@ -323,13 +323,19 @@ static struct soc_camera_platform_info camera_info = { .bus_id = 0, .add_device = ap325rxa_camera_add, .del_device = ap325rxa_camera_del, + .module_name = "soc_camera_platform", }, }; +static void dummy_release(struct device *dev) +{ +} + static struct platform_device camera_device = { .name = "soc_camera_platform", .dev = { .platform_data = &camera_info, + .release = dummy_release, }, }; @@ -346,8 +352,11 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl, static void ap325rxa_camera_del(struct soc_camera_link *icl) { - if (icl == &camera_info.link) - platform_device_unregister(&camera_device); + if (icl != &camera_info.link) + return; + + platform_device_unregister(&camera_device); + memset(&migor_camera_device.dev.kobj, 0, sizeof(migor_camera_device.dev.kobj)); } #endif /* CONFIG_I2C */