From patchwork Wed Feb 17 15:48:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 8340561 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 278FDC0554 for ; Wed, 17 Feb 2016 15:49:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72D7D203B1 for ; Wed, 17 Feb 2016 15:49:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2AAE1203F4 for ; Wed, 17 Feb 2016 15:49:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161680AbcBQPtS (ORCPT ); Wed, 17 Feb 2016 10:49:18 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38210 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161552AbcBQPtN (ORCPT ); Wed, 17 Feb 2016 10:49:13 -0500 Received: by mail-wm0-f44.google.com with SMTP id a4so34252915wme.1; Wed, 17 Feb 2016 07:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=mkYyXIZ0cP8WTFUNyiM5deNDNU5TXMmKzFbKDqf3RE0=; b=vkCct5+aTR+wEdciDowBS6xNZ/1OViski2fq3ch57rcLl3//RbldY040PxiQ+POiZu mUjGdFAIn3eEfFHtcIJm4qnOi9xlVEOCG/YXcgqJcODOLP0Fqe7H1LguSCJomNRQuOVi lno1PRU0JPqxh2KzNPtbmv0xf66CEEYW+01nk1RpgsJSZOtVrZqFIwxC+Cm9fyfGRkQM ww5pPc5M8koORZbnPP6hdcGfI9POw+bgle+bOYlHyHALblVzdfQ7NKAXzCXXbGAwCnzC 6VFSwJ2T8th4H8ODAjV8pcKC3sjPc82+EEPzRhF6b+MxyFpZMpWRuGInRCN6uYb5NsA2 VogQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=mkYyXIZ0cP8WTFUNyiM5deNDNU5TXMmKzFbKDqf3RE0=; b=ZaslZFTduFRxq9PAy2lI6pUpij0uZ5LhzteRAXjKGOR7oHlWtiECnA+zXi2Hqjo9lI lYG1O5S6qk+YcTYmrl6CUwrXxDbm80lCcPJk0sv5Wyit/e4wnLPuytsDA4C/MTqjLsZt 0ijq+iryDN/4Kyhx8aCAopqwYswiOtoPZqYnRPCdJB3Q3wksNVRlU8xdbRn4lBm5v4DZ oIpbbkqoMHbxj7BWIxmI5/oTm/0Ytb7EYySyXx9gp/LaLVF80b0WBAqemKc843jLPV0s 2wL2FE6CuuGW3WynhqVbqtv87MjG2cklMcPGfhQ+tYhrCH2ZDe/ptZnQ6/jf4B5RugsX wKNw== X-Gm-Message-State: AG10YOS9DiwpljNCwGxdTf/MCgssqOPXhOBScmZ65vcaXtWiVQBAX8hNBe3TCUU2BF0crA== X-Received: by 10.194.52.8 with SMTP id p8mr2640691wjo.62.1455724152121; Wed, 17 Feb 2016 07:49:12 -0800 (PST) Received: from groucho.site (ip9234e209.dynamic.kabel-deutschland.de. [146.52.226.9]) by smtp.gmail.com with ESMTPSA id u4sm2136725wjz.4.2016.02.17.07.49.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Feb 2016 07:49:10 -0800 (PST) From: Ulrich Hecht To: linux-renesas-soc@vger.kernel.org, niklas.soderlund@ragnatech.se Cc: linux-media@vger.kernel.org, magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, hans.verkuil@cisco.com, ian.molton@codethink.co.uk, lars@metafoo.de, william.towle@codethink.co.uk, Ulrich Hecht Subject: [PATCH/RFC 4/9] media: rcar_vin: Use correct pad number in try_fmt Date: Wed, 17 Feb 2016 16:48:40 +0100 Message-Id: <1455724125-13004-5-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1455724125-13004-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1455724125-13004-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 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 Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling the subdev set_fmt function - for the ADV7612, IDs should be non-zero. Signed-off-by: William Towle Reviewed-by: Rob Taylor Acked-by: Hans Verkuil [uli: adapted to rcar-vin rewrite] Signed-off-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-dma.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index c667ce5..70dc928 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -294,7 +294,7 @@ static int __rvin_dma_try_format_sensor(struct rvin_dev *vin, struct rvin_sensor *sensor) { struct v4l2_subdev *sd; - struct v4l2_subdev_pad_config pad_cfg; + struct v4l2_subdev_pad_config *pad_cfg; struct v4l2_subdev_format format = { .which = which, }; @@ -303,15 +303,20 @@ static int __rvin_dma_try_format_sensor(struct rvin_dev *vin, sd = vin_to_sd(vin); + pad_cfg = v4l2_subdev_alloc_pad_config(sd); + if (pad_cfg == NULL) + return -ENOMEM; + /* Requested */ rwidth = pix->width; rheight = pix->height; v4l2_fill_mbus_format(&format.format, pix, info->code); + format.pad = vin->src_pad_idx; ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt, - &pad_cfg, &format); + pad_cfg, &format); if (ret < 0) - return ret; + goto cleanup; v4l2_fill_pix_format(pix, &format.format); /* Sensor */ @@ -325,7 +330,7 @@ static int __rvin_dma_try_format_sensor(struct rvin_dev *vin, vin_dbg(vin, "sensor format mismatch, see if we can scale\n"); ret = rvin_scale_try(vin, pix, rwidth, rheight); if (ret) - return ret; + goto cleanup; } /* Store sensor output format */ @@ -334,6 +339,8 @@ static int __rvin_dma_try_format_sensor(struct rvin_dev *vin, sensor->height = sheight; } +cleanup: + v4l2_subdev_free_pad_config(pad_cfg); return 0; }