Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp858997rwb; Thu, 8 Dec 2022 04:01:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf63K52lJskOprrtDS6PXqbXeIRwvA1VcUMBbHepe/BuSRRVr4JRad49aXoHnZd3qj2fa9/z X-Received: by 2002:a17:906:b288:b0:7c1:28ae:66be with SMTP id q8-20020a170906b28800b007c128ae66bemr2141202ejz.669.1670500911069; Thu, 08 Dec 2022 04:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670500911; cv=none; d=google.com; s=arc-20160816; b=qA611dqufBHx3G9w/IHH7VVRGnVYOKZQRYF4B5jgCHTFKhmIkPHshYJ7hJzPS+6esq qCr4x6tlHLDvzZilWR56PVsB+hXUFGzGKd8SSAOhSnZOLXKS5QwW1B3PpVduIyjgntsg lqlUASU4QBJ8VSULx/eCh4egVsBrGrYq3eVDd7xBhnFANXH/6jeC4s/V2aOIkZN6UL3P +b2uixq2gwvFNbDFai87E8mJ3vNE2TS08QAa6YgqooPfiqrn4Zjiekr+4GiTtSvdVcOt RyeYAroqc3Q3pMR4Qn10p5RIcgsJ/2mx42mR26hjpRafaQ+S7aqVJN2lKhz6ztZwSm5K qY8w== 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=V06cmH7+3KG3Z3aGCTZlNsHiYYpIChLqKxMWTWHdb+l95Jk7KhcJJNB2JwIUJFBPgN lM9t1Th97iSmO8vkgpfLrpYNE13eZsdW2ijjMrWdxK3Hx/ivnIbWEePN6nZ4QTQo+fJf cTow22aMFdKCvlfbP6vpvMdmgEKSOq6T/4xDpgXKE7cGP469b4c16mOexl8N7v63l1VD Zt7AnfNlhU8+U7jBvUhT85vQJt5M2kw/GYSIShcJHTUUhWlqiCbA5kI7DmEdO3UGG98J O4broDultWKQFC56gr0mUqUbhwsteN6jKPRI+bn7SEyt6Htrf+N5mhA7GdBxnVL1v5tm 98eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="j/CgJV8V"; 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 d5-20020a056402400500b0046c1b97f6f9si6521285eda.574.2022.12.08.04.01.32; Thu, 08 Dec 2022 04:01:51 -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="j/CgJV8V"; 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 S230112AbiLHLso (ORCPT + 72 others); Thu, 8 Dec 2022 06:48:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiLHLsQ (ORCPT ); Thu, 8 Dec 2022 06:48:16 -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 686E984DF4; Thu, 8 Dec 2022 03:48:10 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 653F5240003; Thu, 8 Dec 2022 11:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670500088; 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=j/CgJV8VPsYt7NneQB0+ZoLdhthaIF5W1Ou+PGIwRuksgooZvVI5DdWSosR97KskYOF4m0 cIDkQUEpD8K0xnbfTWtnWHpGhhK0tFGE/iWmP4+OgIyEWSqAutpiiTAS1mfvToAVVfDAv1 Wti8vVTku4ZHWymGk7hr9h5+ZnLgX/O/obyC3MP378wZtxEYw1RX4t0z2CF/qwnli9LvjN gLpOuSI5u1sr13cGHmlXYTiHGXVDpPnmJ8Us1snHPmcK6cx7VEiGH/wSzLuZ/GY+IYwOpc YoeUyXkrHIHRattvifx9KcQqtRatYxxsTKBca9mEwL1YHlsM9nml2LHiV/pIpQ== 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 4/9] media: sun6i-mipi-csi2: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 12:47:37 +0100 Message-Id: <20221208114742.399461-5-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 --- .../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