From patchwork Thu Jan 16 23:18:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233758 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=unavailable 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 BB0ACC33CB3 for ; Thu, 16 Jan 2020 23:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 904D020748 for ; Thu, 16 Jan 2020 23:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217853; bh=CzXFhGf1ZajCXWtNKPJugt7XNNQ9VS0dodzo8nUu4fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qxcGxx4Wlj7b74B7dQvladGedGoSXlU+gvPQwjzVU28RyRiH0VaWFmU2Zr87czPAt zPO8f7PAUzSv0b6HIQT1O6mRGz2R84HX1iHdvfCvZj4aKc228UfHEalc4Du2UgMjXS KoK5BDFwCOby3x/ZcHTn47grtRpZXur08OcypTPE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391424AbgAPXax (ORCPT ); Thu, 16 Jan 2020 18:30:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:38192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391415AbgAPXau (ORCPT ); Thu, 16 Jan 2020 18:30:50 -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 A32FC20661; Thu, 16 Jan 2020 23:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217449; bh=CzXFhGf1ZajCXWtNKPJugt7XNNQ9VS0dodzo8nUu4fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w3SCKomVsJ11L3+yXMV94nlFQy7SeXVLTa8L+s05qEn6t2WpIoN6i8Q7T+Cpz4s2Y L+6YcFa32zSmvydO3g+o38OPJWaChg6KqkwVckI+mBOTG55vkfDyut8dFZ2FSfeveA 0is+2quIZD12j/DCTUTOXS682tX295qcIr0A3hME= 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 4.19 62/84] media: rcar-vin: Fix incorrect return statement in rvin_try_format() Date: Fri, 17 Jan 2020 00:18:36 +0100 Message-Id: <20200116231720.985507322@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231713.087649517@linuxfoundation.org> References: <20200116231713.087649517@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 @@ -196,6 +196,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); @@ -230,7 +231,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,