From patchwork Wed Sep 4 21:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 11131799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 641B415E9 for ; Wed, 4 Sep 2019 21:54:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 452CE22CF7 for ; Wed, 4 Sep 2019 21:54:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729999AbfIDVye (ORCPT ); Wed, 4 Sep 2019 17:54:34 -0400 Received: from bin-mail-out-05.binero.net ([195.74.38.228]:56483 "EHLO bin-mail-out-05.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727900AbfIDVye (ORCPT ); Wed, 4 Sep 2019 17:54:34 -0400 X-Halon-ID: 86f8d928-cf5e-11e9-837a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [84.172.84.18]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 86f8d928-cf5e-11e9-837a-0050569116f7; Wed, 04 Sep 2019 23:54:11 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Laurent Pinchart , Kieran Bingham , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v3 1/6] rcar-vin: Fix incorrect return statement in rvin_try_format() Date: Wed, 4 Sep 2019 23:54:04 +0200 Message-Id: <20190904215409.30136-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904215409.30136-1-niklas.soderlund+renesas@ragnatech.se> References: <20190904215409.30136-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org While refactoring code the return statement became corrupted, fix it by returning the correct return code. Reported-by: Kieran Bingham Fixes: 897e371389e77514 ("media: rcar-vin: simplify how formats are set and reset" Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- * Changes since v2 - Set ret to 0 if the subdevice do not implement set_fmt and returns -ENOIOCTLCMD instead of returning the not implemented error. --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index cbc1c07f0a9631a4..ec2796413e26822d 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -208,6 +208,7 @@ static int rvin_try_format(struct rvin_dev *vin, u32 which, ret = v4l2_subdev_call(sd, pad, set_fmt, pad_cfg, &format); if (ret < 0 && ret != -ENOIOCTLCMD) goto done; + ret = 0; v4l2_fill_pix_format(pix, &format.format); @@ -242,7 +243,7 @@ static int rvin_try_format(struct rvin_dev *vin, u32 which, done: v4l2_subdev_free_pad_config(pad_cfg); - return 0; + return ret; } static int rvin_querycap(struct file *file, void *priv,