From patchwork Mon Mar 24 19:33:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 3884001 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C3ADB9F2E8 for ; Mon, 24 Mar 2014 19:49:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E87652022F for ; Mon, 24 Mar 2014 19:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07763201F4 for ; Mon, 24 Mar 2014 19:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122AbaCXTti (ORCPT ); Mon, 24 Mar 2014 15:49:38 -0400 Received: from mail-ee0-f52.google.com ([74.125.83.52]:34953 "EHLO mail-ee0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021AbaCXTc5 (ORCPT ); Mon, 24 Mar 2014 15:32:57 -0400 Received: by mail-ee0-f52.google.com with SMTP id e49so4826711eek.11 for ; Mon, 24 Mar 2014 12:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=QiVoSfsLX803oDTg2N6jNeeoKhVzszZx7zvwhkAPPhA=; b=qoCYEkpoodtmn+KsTjETpC89q9L/imJNrTbYT5uyS1M95GXVAFKzm4wPIbDI+fakao P+ADXDUp8svg2hMRbLjWfTGdP4gRAhC2/pssT/C1/wguM4R2gkE6oEvg05zjMr2uV/Qr 2/GhJuXdcSc8Ed+1LVrWuKAFeb1mHkOuJD92eLkoX1JzReESGvOk7gNqcJC6umezXEeH PxZ8tLdoKUrmkGjYA+cDpBcivEA6w8E+nYFleeY97+dZLDBcmJ98MgZrEXLg+OjTBZVj wbH5dwt8ZJoPNhELDnE1yKJFRGxQ1Mq49u2H2GGPIKcjPsZXffeiDcBibSjZT17imw4R 8cNw== X-Received: by 10.15.32.206 with SMTP id a54mr64628999eev.51.1395689576514; Mon, 24 Mar 2014 12:32:56 -0700 (PDT) Received: from Athlon64X2-5000.site (ip-109-91-213-89.unitymediagroup.de. [109.91.213.89]) by mx.google.com with ESMTPSA id m1sm35132640een.7.2014.03.24.12.32.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 12:32:55 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 05/19] em28xx: move struct v4l2_clk *clk from struct em28xx to struct v4l2 Date: Mon, 24 Mar 2014 20:33:11 +0100 Message-Id: <1395689605-2705-6-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1395689605-2705-1-git-send-email-fschaefer.oss@googlemail.com> References: <1395689605-2705-1-git-send-email-fschaefer.oss@googlemail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-camera.c | 11 ++++++----- drivers/media/usb/em28xx/em28xx-video.c | 6 +++--- drivers/media/usb/em28xx/em28xx.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index daebef3..c2672b4 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -330,13 +330,14 @@ int em28xx_init_camera(struct em28xx *dev) char clk_name[V4L2_SUBDEV_NAME_SIZE]; struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus]; struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus]; + struct em28xx_v4l2 *v4l2 = dev->v4l2; int ret = 0; v4l2_clk_name_i2c(clk_name, sizeof(clk_name), i2c_adapter_id(adap), client->addr); - dev->clk = v4l2_clk_register_fixed(clk_name, "mclk", -EINVAL); - if (IS_ERR(dev->clk)) - return PTR_ERR(dev->clk); + v4l2->clk = v4l2_clk_register_fixed(clk_name, "mclk", -EINVAL); + if (IS_ERR(v4l2->clk)) + return PTR_ERR(v4l2->clk); switch (dev->em28xx_sensor) { case EM28XX_MT9V011: @@ -448,8 +449,8 @@ int em28xx_init_camera(struct em28xx *dev) } if (ret < 0) { - v4l2_clk_unregister_fixed(dev->clk); - dev->clk = NULL; + v4l2_clk_unregister_fixed(v4l2->clk); + v4l2->clk = NULL; } return ret; diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 22acb0f..4fb0053 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1974,9 +1974,9 @@ static int em28xx_v4l2_fini(struct em28xx *dev) v4l2_ctrl_handler_free(&v4l2->ctrl_handler); v4l2_device_unregister(&v4l2->v4l2_dev); - if (dev->clk) { - v4l2_clk_unregister_fixed(dev->clk); - dev->clk = NULL; + if (v4l2->clk) { + v4l2_clk_unregister_fixed(v4l2->clk); + v4l2->clk = NULL; } kref_put(&v4l2->ref, em28xx_free_v4l2); diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 910c2d8..a4d26bf 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -503,6 +503,7 @@ struct em28xx_v4l2 { struct v4l2_device v4l2_dev; struct v4l2_ctrl_handler ctrl_handler; + struct v4l2_clk *clk; }; struct em28xx_audio { @@ -568,7 +569,6 @@ struct em28xx { unsigned int has_alsa_audio:1; unsigned int is_audio_only:1; - struct v4l2_clk *clk; struct em28xx_board board; /* Webcam specific fields */