From patchwork Sun Mar 30 21:51:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 23301 X-Patchwork-Delegate: g.liakhovetski@gmx.de Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1WUNds-0002H5-O2; Sun, 30 Mar 2014 23:51:48 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1WUNdq-0007e3-3x; Sun, 30 Mar 2014 23:51:48 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbaC3Vvo (ORCPT + 1 other); Sun, 30 Mar 2014 17:51:44 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:48445 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751750AbaC3Vvn (ORCPT ); Sun, 30 Mar 2014 17:51:43 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id E415346221C; Sun, 30 Mar 2014 22:51:41 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BNJjSKXtAcvp; Sun, 30 Mar 2014 22:51:39 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.133]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 29FF3460AFC; Sun, 30 Mar 2014 22:51:39 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1WUNdi-0002rg-Sk; Sun, 30 Mar 2014 22:51:38 +0100 From: Ben Dooks To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, linux-sh@vger.kernel.org, Ben Dooks Subject: [RFCv2] rcar_vin: copy flags from pdata Date: Sun, 30 Mar 2014 22:51:37 +0100 Message-Id: <1396216297-10981-1-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.9.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.3.30.214218 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' The platform data is a single word, so simply copy it into the device's private data structure than keeping a copy of the pointer. This will make changing to device-tree binding easier as it is one allocation instead of two. Signed-off-by: Ben Dooks --- drivers/media/platform/soc_camera/rcar_vin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 702dc47..47516df 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -126,13 +126,13 @@ struct rcar_vin_priv { int sequence; /* State of the VIN module in capturing mode */ enum rcar_vin_state state; - struct rcar_vin_platform_data *pdata; struct soc_camera_host ici; struct list_head capture; #define MAX_BUFFER_NUM 3 struct vb2_buffer *queue_buf[MAX_BUFFER_NUM]; struct vb2_alloc_ctx *alloc_ctx; enum v4l2_field field; + unsigned int pdata_flags; unsigned int vb_count; unsigned int nr_hw_slots; bool request_to_stop; @@ -275,12 +275,12 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) break; case V4L2_MBUS_FMT_YUYV8_2X8: /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ - vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ? + vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601; break; case V4L2_MBUS_FMT_YUYV10_2X10: /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ - vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ? + vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601; break; default: @@ -799,7 +799,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd) /* Make choises, based on platform preferences */ if ((common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) && (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)) { - if (priv->pdata->flags & RCAR_VIN_HSYNC_ACTIVE_LOW) + if (priv->pdata_flags & RCAR_VIN_HSYNC_ACTIVE_LOW) common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_HIGH; else common_flags &= ~V4L2_MBUS_HSYNC_ACTIVE_LOW; @@ -807,7 +807,7 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd) if ((common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) && (common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)) { - if (priv->pdata->flags & RCAR_VIN_VSYNC_ACTIVE_LOW) + if (priv->pdata_flags & RCAR_VIN_VSYNC_ACTIVE_LOW) common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_HIGH; else common_flags &= ~V4L2_MBUS_VSYNC_ACTIVE_LOW; @@ -1447,7 +1447,7 @@ static int rcar_vin_probe(struct platform_device *pdev) priv->ici.drv_name = dev_name(&pdev->dev); priv->ici.ops = &rcar_vin_host_ops; - priv->pdata = pdata; + priv->pdata_flags = pdata->flags; priv->chip = pdev->id_entry->driver_data; spin_lock_init(&priv->lock); INIT_LIST_HEAD(&priv->capture);