Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1032041rwb; Thu, 8 Dec 2022 06:05:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6H2rLUxx1MOe+Wyd3sCbDf/xgguwgUkontcBS46RyJhE/2gLqGIYqpRyP9pfFLK4rnUawm X-Received: by 2002:a17:903:187:b0:189:de92:ab2c with SMTP id z7-20020a170903018700b00189de92ab2cmr14966115plg.113.1670508316349; Thu, 08 Dec 2022 06:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670508316; cv=none; d=google.com; s=arc-20160816; b=f6ZB5X2H7Qwn9C4Yg7tcS6ILrflaVIX+Y6H/l/JgbUFJAR/rrNmBoQhGjfe/ugcU4d oL2QF8KwP6oEhIun2/EBAV1tAvgcImOyhovgD8QXiJhu64ccUWJvKoxifgF3Jg7bE0ky Kpc7D2dIJMHy6OO1adbnAJPzxve+G5UsQAtcXown/Ju9D+dEewoCiuXfXOZh2ztnB+nN WcS99TTnDMvHacRYIDw2ziyDT4Qw1mWK2Js4yvwyhga9tMgdYcIKxtJD4e47egh2703N OHsJOUP3Zc2+U5WGKu9TnOgiF3ykb7yUTD2npnGJqp1aXL6wQ+IIELSQod9FovUS6gXI wnhg== 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=ouWKzqsDgZK+P2K4sD/sUt6ULAodum5ydIAbhP5DW1+80ZEWHAW98eDQyWq+1mJsfW EXnWAPD3C224SyuGwjrcy+eGtG1ImpW5W9egtF6WwrNazWe1L+b98ZKrS8ge14p6Mjgb XkWaB2dpYXfz0BHcme6pDeVPbDzrqSQk9aAB48RroKkdKAd1C+507wLpX8kSE2LOprWs JXLtXuSnpCZNEzs/mXEHIqAMGw788vFnHLhAXVJ3wV5qLZlrsS9WoitpsAiEo4hVt6Z9 R70vKX6wuJiVzhxzvvPRv3ZobpPActKQTnsMkY/w1aXi6eHk4R/egvWHoeYJpysfT1Wk NLIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KachgUH+; 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 h15-20020a170902ac8f00b00178aec118c9si22327651plr.378.2022.12.08.06.05.04; Thu, 08 Dec 2022 06:05:16 -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=KachgUH+; 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 S229865AbiLHN4M (ORCPT + 73 others); Thu, 8 Dec 2022 08:56:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbiLHNz7 (ORCPT ); Thu, 8 Dec 2022 08:55:59 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A6936C4E; Thu, 8 Dec 2022 05:55:51 -0800 (PST) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id AEA0D20010; Thu, 8 Dec 2022 13:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1670507748; 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=KachgUH+BTo9uZXQg85VIRkTKJoQPvyz2Kug9bdMj2QcP+2q00ynBPVoMwHHs8SpIef3yE X8rc5qRvWluBQLaRhZhRvxGTLClbS4pfTP1JxiHX8cBrNtUDZL8bgE854bd1peVfmv454F Niztb3cCJLkdAVWjBJqGQegpbgYmIM6jSs73hoXlKpBiPBIZEYALs3RrzFVP9fOt5KyUau HCIALluQGPsPG5eSMjB4qdp1cZHiwD6D+KMELtPfSeRMdJsmTlHw8HQw1htoMDSP+3VcxC MvMKW199WLGWR+ACrXzgTQcnwGEjyI0s/rRLiZrTN5WAB5W6Uw1/84njASb9Ig== 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 05/11] media: sun6i-mipi-csi2: Fix return code handling in stream off path Date: Thu, 8 Dec 2022 14:55:06 +0100 Message-Id: <20221208135512.421903-6-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 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