From patchwork Sun Jun 15 19:56:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 4354871 Return-Path: X-Original-To: patchwork-linux-sh@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 201E09F314 for ; Sun, 15 Jun 2014 19:57:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33173201B9 for ; Sun, 15 Jun 2014 19:57:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 485AB201BB for ; Sun, 15 Jun 2014 19:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750981AbaFOT47 (ORCPT ); Sun, 15 Jun 2014 15:56:59 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:38715 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752015AbaFOT46 (ORCPT ); Sun, 15 Jun 2014 15:56:58 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 6812747872B; Sun, 15 Jun 2014 20:56:57 +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 4g-PfBUgTQvQ; Sun, 15 Jun 2014 20:56:52 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.179]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id B0572478709; Sun, 15 Jun 2014 20:56:36 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1WwGXc-0004dG-GY; Sun, 15 Jun 2014 20:56:36 +0100 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk, linux-sh@vger.kernel.org, linux-media@vger.kernel.org Cc: robert.jarzmik@free.fr, g.liakhovetski@gmx.de, magnus.damm@opensource.se, horms@verge.net.au, ian.molton@codethink.co.uk, william.towle@codethink.co.uk, Ben Dooks Subject: [PATCH 5/9] rcar_vin: copy flags from pdata Date: Sun, 15 Jun 2014 20:56:30 +0100 Message-Id: <1402862194-17743-6-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1402862194-17743-1-git-send-email-ben.dooks@codethink.co.uk> References: <1402862194-17743-1-git-send-email-ben.dooks@codethink.co.uk> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 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 e594230..7c4299d 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: @@ -797,7 +797,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; @@ -805,7 +805,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; @@ -1445,7 +1445,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);