Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp908263rwb; Thu, 8 Dec 2022 04:38:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5klI9SOYY7qcJkBSfc1uPyCWHo2DLzejBEdteuxDYTBRwjHotJjVuE4Cn/rgC+dWVsbb1h X-Received: by 2002:a17:902:bd42:b0:186:9c2b:3a39 with SMTP id b2-20020a170902bd4200b001869c2b3a39mr79015239plx.115.1670503100582; Thu, 08 Dec 2022 04:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670503100; cv=none; d=google.com; s=arc-20160816; b=hW+KwnlusNSrlQ7dSEVkTqekyRcRmo45hA2bCmzFG5omIqGajBA7T7EkYZ70UKlBgL gNBZFoSw7DKIYx8jMHj5wCsi6lY7uMIZtZsxyTxFtc5dEb2+WRzlm12IZ5GmOBaocunu wToYKC1Jc5lVFD3Psys5jwVCB878Hfz2sQmBis9yO2ByNkDs4Dld9cX/SpJ1nt4XyQvn t4UwEs2JcOh0U0rt7ovzVSxjTdkQPN92Wpks6WwiJAG9EUS2UMJj3rdNPIkO5NAaZzUW gYIs2rIO7/qj+QDFZd4d9JWmABgDuNiMEtgdjjo+E/Qq0V1Md3g+FXMBdJrIQnL/nDky DBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0FPh8ptOOh3/7vfnCNdEW59LErgazMVmLGY6D+7mMsQ=; b=Zd8aIBpssHYHHp2WwkBP43Wc/MZUe28UFs2JML4f7JwV6dUw4ADlGOc48VYaAw140H mQSYwETGxDiy2+3ssGGLjolZ3B8I36PimjQDqgglZnGai9QwM4e+sgHbtrw08NgwWzvM gX2T/fYeocztowURnD7YW+hBN1IZC54ootmipsFIbY3dne6hK5Eeqz0a+PvJxXG68ADP A/nWeh4lzfqEJui5TB7DIZe++s8i7LHpVv0aL1d7jY/BTqFJJ8Qh7zHIzWAsVUhCki2A H8K3KhUZhC8RCXEwuZf5CG2AXcGAtibfeEv3F3PoTptSkUSxCuLJEUUsw6e65L6fIy+4 cXGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Vz3FisI+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gm16-20020a17090b101000b00213b01e42adsi4082898pjb.42.2022.12.08.04.38.09; Thu, 08 Dec 2022 04:38:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Vz3FisI+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbiLHLtK (ORCPT + 72 others); Thu, 8 Dec 2022 06:49:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiLHLsR (ORCPT ); Thu, 8 Dec 2022 06:48:17 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1541E2610F; Thu, 8 Dec 2022 03:48:11 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 1A47524000C; Thu, 8 Dec 2022 11:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500090; 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=Vz3FisI+TWdgUpXSmKJiPTe02vG17f0vmNae7kyIJC7joJLRHqanBB3W5fBrkIShBXtpw/ g89LyPAN2g/Umz6R9EOjH/kX0fv60Il6dZ+9MHsjReZQGs4yFvl17q0Q+sr9P+0mE+VgoY 8qr05bsEUmteOWYRNh4c4jO7CjMHEH17X/DQnYq73+qUJGw8bNk3GjVRy78gl8MMJvrJFd JsW0Xdqn6fePfro4RWZcqY43PfDKmnKJEC9owc18+yyT2xeGcir0CoxiqUhJ44DrSguJA+ KV8xScsZFumWIARKR6p3l17lH1rEQJUYU/wJtueUb6k6biq42pHZfQ7iKhsriA== 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 Subject: [PATCH 5/9] media: sun8i-a83t-mipi-csi2: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 12:47:38 +0100 Message-Id: <20221208114742.399461-6-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> References: <20221208114742.399461-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.38.1