From patchwork Thu Dec 8 13:55:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 31355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp207574wrr; Thu, 8 Dec 2022 05:57:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf6SMefforf7bHnc1hfDOdjob7RUsdEIUKurAOWU0HJ7bztRg5ffNKsPj1xkxSTrSOFyn8iv X-Received: by 2002:a62:6d02:0:b0:562:3411:cb3a with SMTP id i2-20020a626d02000000b005623411cb3amr78045641pfc.60.1670507829450; Thu, 08 Dec 2022 05:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670507829; cv=none; d=google.com; s=arc-20160816; b=BYIwe8tzmoNLw71kjcssV9yUuUpHBcZj5Bt/UlzOMX8He9znUMdyv1d6VBEejnLAqu j92HAyBtgnLuAmsYcmV+H/ypBuJOhE2Urntu7ka1ohhEKdbJ4RhFkAEgFiZQLRO155OO QNEbmW/OG3N2MukcPkpH/iCah6ffrdgpHLPSv9NqwTc8WS0nNU1r9xmqjtmA87yCIjWK LulYrvbBJRgmBomg5BFAALjZAONZXM6BvGeZqjq+46gTTcrW7yaAxGnvOxjLV3OZXAjW as5Kn9ti0eEpauDV9uoWIJsLeUngAS7eRG8P7kOKWcVV2Q/T7sJ/g8A0Fr9LA6Y4z6a7 UaRw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a627901000000b0056ea2b142b6si23682310pfc.373.2022.12.08.05.56.56; Thu, 08 Dec 2022 05:57:09 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751654417840676285?= X-GMAIL-MSGID: =?utf-8?q?1751654417840676285?= 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);