From patchwork Thu Dec 8 13:55:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 13068436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F86BC3A5A7 for ; Thu, 8 Dec 2022 13:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9xBARswLBNJqqA2yb4x9Aj7oQmWvZ72poRCNV9tefdY=; b=Fpi6ImE1KBUKjM 04cn8YUq/HfQdlwcgOJ0iTPSKZxh4AlnVPZkiJt8H9H+nc4jNVSzfbwnMjkwzyh4fffrWef7WRqdT 4hP9GY/KbGS6PXpwlPUlvvocf3nDRvrCUIQpmHxNZqookdFXdPRSIdPRg7rpO+cIE4PHdBkCJ7Enw vOYF5i1xvFSeitOSGGRpxkODYU0gpuP+aFr5qvbVzlgcGL2JQzQyZ2P1cYeBHR/1oHontofOuFZOF xHUHWtng98iNj3OiE3z6+T8f+dJVYsLNPKDGw8QeNuUQoAqLrMs24LQJgt4JsbALvF0GB3/sF5DQn tKnifK0eAwL7FR/4wkNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3HP5-001SUB-7X; Thu, 08 Dec 2022 13:57:35 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3HNP-001Qxn-OI for linux-arm-kernel@lists.infradead.org; Thu, 08 Dec 2022 13:55:53 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 9440A20008; Thu, 8 Dec 2022 13:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670507750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0FPh8ptOOh3/7vfnCNdEW59LErgazMVmLGY6D+7mMsQ=; b=OpQHeV9h/Ucy0U6RdrjjwoPB8qYPHb2OiVUJNvgD/ovhQvxGfizbAIEtnO8VRquM/miw/d P+50v+5bY0vHlXF0EUUwG77aAactFihJx2uTBa+kjk7GA1oyihQN/K15ah10wgzmHAHIZv eJeiQcJy0wefhZW/q5D3WFAJBxsZ+Qi3qY6ShZBaF6962n3JwR7OwSemqRSn1+WSRl5KHK xTaNmNtGbD+iz/FR8kTSYjwS1bCt4+/4cIN+pfLESXXI449pQ/61iFn3goUofEpsXo9Lkz unCMEYFhqFqN+HM82cfWr6M/ZfSZEdv+bqCP7rxUrdhv+2Sg2dAXBUoZzKUTgA== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thomas Petazzoni , Hans Verkuil , Sakari Ailus , Conor Dooley , Nathan Chancellor Subject: [PATCH v2 06/11] media: sun8i-a83t-mipi-csi2: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 14:55:07 +0100 Message-Id: <20221208135512.421903-7-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208135512.421903-1-paul.kocialkowski@bootlin.com> References: <20221208135512.421903-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221208_055551_966193_43BB570B X-CRM114-Status: GOOD ( 10.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Explicitly set ret to zero instead of assigning it and overwriting it later, which is a bit confusing to understand. Signed-off-by: Paul Kocialkowski --- .../sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c index d993c09a4820..cd2e92ae2293 100644 --- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c @@ -220,7 +220,8 @@ static int sun8i_a83t_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return -ENODEV; if (!on) { - ret = v4l2_subdev_call(source_subdev, video, s_stream, 0); + v4l2_subdev_call(source_subdev, video, s_stream, 0); + ret = 0; goto disable; } @@ -312,8 +313,6 @@ static int sun8i_a83t_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return 0; disable: - if (!on) - ret = 0; phy_power_off(dphy); sun8i_a83t_mipi_csi2_disable(csi2_dev);