Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1062840rwb; Thu, 8 Dec 2022 06:22:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TTgNJr+1dK5DkNmqNOva9NSZVMYjYFDi9fZtdSGIEcrZLRlkTg8XWcvHXyw2scAlmchA7 X-Received: by 2002:a63:5d62:0:b0:477:2263:a5d with SMTP id o34-20020a635d62000000b0047722630a5dmr76903493pgm.536.1670509377980; Thu, 08 Dec 2022 06:22:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670509377; cv=none; d=google.com; s=arc-20160816; b=TJhCrVHiLE1gxLYY1tKPdnhb8f6GK+q8BftQQWjvt7ecpeY5VZCxf7X+Xt/RiNikKV sRmaLB0kGo1cNz90bhPMPpwpqqHa7vnIePoHoFoIgdIQgTUD/twnEp0xFWNLDqHucuzw j+em41S8x4IowHbnmhLYLSj+JdYdzDoT1eVHO0unOL7S+3cFrjtK4Vrl0kj2rqkVNfP2 EmvflHJwM1Eg0F+fEPTqXb+4VRen5r/a0f9/abzZs8l0Cy720pPPeldchao00MCNaB66 D+HteH8H1AbIHNmcX/VjittLgHrhXDIwGt/5Hxb+eoO2+AH1N0OQmbrXsjhWsqlH59a8 W0mw== 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=x+m8Ttbwva1nFMm1VuG5CKBT3hyXYzde62LJOYY94DJ/1RJjSIAiFJ14UrofzcMGRy S9XnfasYYK7VchIVPXe3Xc9O9RtOZp/qB1EESa5tA8PrrPI5mK72MJAcjNHX9PxKUA8c ncssdJLsN1CNBcTSVRekJNngcA9iIDjdrHNzNlR6n8UnBELlUCg/iuHW63Obo7FgA7/g tnK4E0KjcQqiZClnESD3kBL+1fkNNwYVPF1nBEGFo+qgBzy9EmlcF1gWpz5ZJo/hFFxG Afao3XXntDQlTi+/ApMPZ1yXdDRHSE6ZJaLMH9sBKftR+WK3q2BbokfCrs4YFXWssOhN fQ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OpQHeV9h; 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 j14-20020a63cf0e000000b00477257f2f01si23251803pgg.339.2022.12.08.06.22.48; Thu, 08 Dec 2022 06:22:57 -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=OpQHeV9h; 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 S230287AbiLHN4P (ORCPT + 72 others); Thu, 8 Dec 2022 08:56:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbiLHN4C (ORCPT ); Thu, 8 Dec 2022 08:56:02 -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 C9EF593A59; Thu, 8 Dec 2022 05:55:51 -0800 (PST) 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 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