Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1091351rwb; Thu, 8 Dec 2022 06:42:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4dd4+VgbGjP7fsYGGKUkglZkVcyXG3GokWf7p/5l8CGhrmwuygdnZKOc9YDXLiaokyLta4 X-Received: by 2002:aa7:8553:0:b0:576:a443:904e with SMTP id y19-20020aa78553000000b00576a443904emr22225699pfn.83.1670510528146; Thu, 08 Dec 2022 06:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670510528; cv=none; d=google.com; s=arc-20160816; b=fWPqvAaODLtslUN07kGaC9BcA16i71jtHzS71oNn1F1Q3kKtVh5MWGPPNpQRAMd4oK Bz+FQV0tM7yqFQgsdzkkhzdsb6d0dm74VR3xLDBsQUk/9bAyRtOjBn2TO8Mcms8xbodL p2KHrLVrC2fOYfV3qrwlotB6vmTr3thFMh3Adwtop2x2Xo0l9J+0y/DASJqh39NZ3jhv Vu/V7aMyZDEK/hGPMCFGXa4y4FXU67S6G5mG49qrDvD5FpEeMu0gqvQizilq318m5xbq rIVeixZV0iZuf20JUG4E+vfTr/bJXgTBj9YgfQgNGNa6/hQghefTHreLPwG+yusiB96C bNgg== 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=DcI0CE2vpt8M7xlyKhWsNrg5u9xwZtrv/Ts2Ew1lIMc=; b=EAGf/y98whyggM7Ds2ffFq/DoWGmTNguFqsgAaOEVOkUiTtRLmViRitxm81awjYLXe 9Ud53o5K0qrl40RRUaFXAEOQ/LFu8q5WeSkQ11fHh3Oy2Dtyh++sSrjPzauwBppjDj5v JdGYAig1v21DyH/LtKe0f+5Wny7U/JtSFsGKn9xn8H3DoUv+Hs8KKWddYe8o0f6R1yFY DskQcxdfI+IfJJ4qZY5XARlFoWtiVi8Uy7qnpnPis5vlM/4pnF0yI9KZ1zeaBx8yChKt V+BcVlXxzqjay13lgcbq0i/laSWycG5xr13wFghh6MoeOr7wI7OJVDF6yNWSrHaMWjgz qeAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NUTQupy9; 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 k2-20020a63d842000000b004785d99321bsi16579382pgj.598.2022.12.08.06.41.58; Thu, 08 Dec 2022 06:42:08 -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=NUTQupy9; 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 S230025AbiLHOU4 (ORCPT + 72 others); Thu, 8 Dec 2022 09:20:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbiLHOUo (ORCPT ); Thu, 8 Dec 2022 09:20:44 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CCCC84DD2; Thu, 8 Dec 2022 06:20:39 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E8DDCC001E; Thu, 8 Dec 2022 14:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670509237; 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=DcI0CE2vpt8M7xlyKhWsNrg5u9xwZtrv/Ts2Ew1lIMc=; b=NUTQupy9h9GiEVOPXOZIucyLmIa8F5OCH+jK9GuNbCCMRX/nWubMvp8590YSc0Di8t66N3 c2fqtdypEndYmjytjJuaVGrDAaqoDGn0nXhWWPCy4H9ECzo+lfVH3k9zxz3/MD/s/tK65c /DJlwZxNCSf9vdrmsttFr424GCXMTPg2OdNwh2LpTkIHtT4O7v4fMgsIA2rdInUh4sXFfb WwsXK5CHXnu12C4nteflqtOI3grHazyb0qjKY3oCQg4m8/AoB+n4GnRPcTYqgrXZhx0htd B8QX6wI3kpzjjRDi04QMNGibIjIbD21CC9MjrDDWebwJE+mPwrwSPfxC6cD+Yg== 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 v3 05/12] media: sun6i-mipi-csi2: Clarify return code handling in stream off path Date: Thu, 8 Dec 2022 15:19:59 +0100 Message-Id: <20221208142006.425809-6-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221208142006.425809-1-paul.kocialkowski@bootlin.com> References: <20221208142006.425809-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 --- .../media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c index 484ac5f054d5..a220ce849b41 100644 --- a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c +++ b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c @@ -188,7 +188,8 @@ static int sun6i_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; } @@ -280,8 +281,6 @@ static int sun6i_mipi_csi2_s_stream(struct v4l2_subdev *subdev, int on) return 0; disable: - if (!on) - ret = 0; phy_power_off(dphy); sun6i_mipi_csi2_disable(csi2_dev); -- 2.38.1