From patchwork Thu Jan 16 23:17:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0A85C33CAF for ; Thu, 16 Jan 2020 23:25:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 883A02072B for ; Thu, 16 Jan 2020 23:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217107; bh=m8xS/QdXqDzMIWCYpmKHpbVJ73ewjXOb5tJMfMZoxEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LlzfL6wjpNINEIWgRF6SYpWc1RKtZhRhSPHAgQ0f7PEzisFwUTh+8lP+OCuiFkR9s dif5TF40RsC7WuF9Jo5ShlttUtSZ0ldF4opp2bRErAFWJstyfa7S97+2FhjyvVqfp6 Ikb5UZfRAN5aAeXaW1G0rMT8A/fyHr9jPMtvfusU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730958AbgAPXZH (ORCPT ); Thu, 16 Jan 2020 18:25:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:54534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729946AbgAPXZG (ORCPT ); Thu, 16 Jan 2020 18:25:06 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F6B22075B; Thu, 16 Jan 2020 23:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217105; bh=m8xS/QdXqDzMIWCYpmKHpbVJ73ewjXOb5tJMfMZoxEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cMPq7UJ24ApHpcc0QY5lT9iFVROdYZYYyTHoSorUL3K9L2jQT2rL5ImHJJhN1jSJ6 OusxBWdT3VrnVIzbZVW5M9G6jjBR4tPGCbzmJBvph7v50hAOFCa5CIAK3XEkMd2Nu8 gbr+efKwZVv0D+hFgtcvHzlrJodPtoLEDmL8+jRc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kieran Bingham , =?utf-8?q?Niklas_S=C3=B6de?= =?utf-8?q?rlund?= , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.4 150/203] media: rcar-vin: Fix incorrect return statement in rvin_try_format() Date: Fri, 17 Jan 2020 00:17:47 +0100 Message-Id: <20200116231758.004486179@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Niklas Söderlund commit a0862a40364e2f87109317e31c51c9d7bc89e33f upstream. 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- 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_d 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_d done: v4l2_subdev_free_pad_config(pad_cfg); - return 0; + return ret; } static int rvin_querycap(struct file *file, void *priv,