From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC450C00140 for ; Fri, 5 Aug 2022 14:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UUX61EEectMQkIpcmt8qps1p+qj0aV44z/d0KgcUAKU=; b=i9B8Ewhxkqx18FpXgRnIy7Jzf1 vTfyZBgN8C+j/UIinHAaeYXK4ag6F56BGxSQcgC/RohewpyncIRSPCsnZcu4gEC3jH0K6RSe4HiMb 1w1tce70Ymug1flJtru4jd5GDHHpqo+otiPBthhOSuvX2y2jVFh2L0XhA+w0YSBwE3li+OFCIRWP0 uOuFQiHwk4gWOATA7BPaCG9MdoTN9Y2zJzMP/G70QNrRbM/YgK7KGoD+KnYpkTOx7bOWqkO93T6lG TcdXFP2hpAcwN0I9Y7gidy3tp2CoDOEBoR6oaGMczE2WOazVGNnmVH0/xugUv6SOUFfF6FJQtzwN7 khOzxKZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJy2v-00Fjab-4q; Fri, 05 Aug 2022 14:11:26 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJy29-00Fj9F-VK for linux-arm-kernel@lists.infradead.org; Fri, 05 Aug 2022 14:10:40 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C1C2BE000C; Fri, 5 Aug 2022 14:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1659708631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vwkQ0qv8d11cIg/eLHddZY+Oe9mA1gFNjKFinhC1Y8M=; b=Y1gyFXYgDm/ZkaFa+HUYy1liTzoVSUHLysu92DcYh1vFOetVC5OCigjwOg1EJ601fO8iHZ mwz27HvzOeoLBrFX1bv/bOd5HIIUlkzrhie3LRcoErS94ZhGHUBsEYkhq8l/fzH/ST3dtb 3uNjPFxSo1WyCtvHdhitFluYFvCtRWJcJ9QQALKn1RCjAGggmQEwgNLC+kkS5xLBVrFuJc fECGlIB4YnmVUmqS1r5zxgDqRBhPr0Zb8/rhUYREU5KZad1vAgqBMYTGEFbUFsQxQFunyI leci3TREwFuoLw+BCmfXHLpZ9U4SKNvo0FgL7NectIbI5moe970rgDny7E0Dsw== Date: Fri, 5 Aug 2022 16:10:28 +0200 From: Paul Kocialkowski To: Christophe JAILLET Cc: Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Hans Verkuil , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 1/2] media: sunxi: Fix some error handling path of sun8i_a83t_mipi_csi2_probe() Message-ID: References: <62c0aef8d3b86d8f290bf6787f1b2b41efbb0b55.1659295329.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 In-Reply-To: <62c0aef8d3b86d8f290bf6787f1b2b41efbb0b55.1659295329.git.christophe.jaillet@wanadoo.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_071038_499404_E423B3B2 X-CRM114-Status: GOOD ( 26.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6231877262695501194==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6231877262695501194== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hqu9GGmQSmzk8QQV" Content-Disposition: inline --hqu9GGmQSmzk8QQV Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Christophe, On Sun 31 Jul 22, 21:22, Christophe JAILLET wrote: > Release some resources in the error handling path of the probe and of > sun8i_a83t_mipi_csi2_resources_setup(), as already done in the remove > function. Great finds, thanks! Just some nitpick about the label names to make them consistent with other labels (also from the sun6i-csi rework). =20 > Fixes: 576d196c522b ("media: sunxi: Add support for the A83T MIPI CSI-2 c= ontroller") > Signed-off-by: Christophe JAILLET > --- > I'm unsure about the phy_exit() call in > sun8i_a83t_mipi_csi2_resources_cleanup() because no explicit phy_init() > call is performed. >=20 > The same code is in sun6i-mipi-csi2/sun6i_mipi_csi2.c, but in this driver > phy_init() IS called. >=20 > I leave it as-is because I don't if it is an issue or not. > My feeling is that it is a copy'n'paste error and that it should be > removed. > --- > .../sun8i_a83t_mipi_csi2.c | 21 ++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) >=20 > 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 d052ee77ef0a..67c7475d5d10 100644 > --- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_c= si2.c > +++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_c= si2.c > @@ -719,13 +719,15 @@ sun8i_a83t_mipi_csi2_resources_setup(struct sun8i_a= 83t_mipi_csi2_device *csi2_de > csi2_dev->clock_mipi =3D devm_clk_get(dev, "mipi"); > if (IS_ERR(csi2_dev->clock_mipi)) { > dev_err(dev, "failed to acquire mipi clock\n"); > - return PTR_ERR(csi2_dev->clock_mipi); > + ret =3D PTR_ERR(csi2_dev->clock_mipi); > + goto err_put_clk_rate; > } > =20 > csi2_dev->clock_misc =3D devm_clk_get(dev, "misc"); > if (IS_ERR(csi2_dev->clock_misc)) { > dev_err(dev, "failed to acquire misc clock\n"); > - return PTR_ERR(csi2_dev->clock_misc); > + ret =3D PTR_ERR(csi2_dev->clock_misc); > + goto err_put_clk_rate; > } > =20 > /* Reset */ > @@ -733,7 +735,8 @@ sun8i_a83t_mipi_csi2_resources_setup(struct sun8i_a83= t_mipi_csi2_device *csi2_de > csi2_dev->reset =3D devm_reset_control_get_shared(dev, NULL); > if (IS_ERR(csi2_dev->reset)) { > dev_err(dev, "failed to get reset controller\n"); > - return PTR_ERR(csi2_dev->reset); > + ret =3D PTR_ERR(csi2_dev->reset); > + goto err_put_clk_rate; > } > =20 > /* D-PHY */ > @@ -741,7 +744,7 @@ sun8i_a83t_mipi_csi2_resources_setup(struct sun8i_a83= t_mipi_csi2_device *csi2_de > ret =3D sun8i_a83t_dphy_register(csi2_dev); > if (ret) { > dev_err(dev, "failed to initialize MIPI D-PHY\n"); > - return ret; > + goto err_put_clk_rate; > } > =20 > /* Runtime PM */ > @@ -749,6 +752,10 @@ sun8i_a83t_mipi_csi2_resources_setup(struct sun8i_a8= 3t_mipi_csi2_device *csi2_de > pm_runtime_enable(dev); > =20 > return 0; > + > +err_put_clk_rate: Please call this "error_clock_rate_exclusive", > + clk_rate_exclusive_put(csi2_dev->clock_mod); and add a blank line here. > + return ret; > } > =20 > static void > @@ -778,9 +785,13 @@ static int sun8i_a83t_mipi_csi2_probe(struct platfor= m_device *platform_dev) > =20 > ret =3D sun8i_a83t_mipi_csi2_bridge_setup(csi2_dev); > if (ret) > - return ret; > + goto err_cleanup_resources; > =20 > return 0; > + > +err_cleanup_resources: Please call this "error_resources", > + sun8i_a83t_mipi_csi2_resources_cleanup(csi2_dev); and add a blank line here. Thanks! Paul > + return ret; > } > =20 > static int sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_= dev) > --=20 > 2.34.1 >=20 --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --hqu9GGmQSmzk8QQV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmLtJNQACgkQ3cLmz3+f v9EKVgf/eJBH4biR6Ppa4WNEg0C3+uaXI4M06qGKmX8fWvyljWZ6L9Q7WoDOt0+P lM5SJdnMNd/dDUzm2JZ/U6R+ojz6tmWM4VhEAFQG/VfiTIh0nqFkuqRXcOBL9MSG S8ekLSy0MpnVwxP4kWRu6VLAjemciTixmBPLSpxT87+a2kWxRd5AsU7e02y1MkhZ eRK1BzErjvpkC2YpoQs+GPWf83Fblns9iDu12Rm4VH8q56WOJ7Rcg6CqIoskQDU7 ia2fR8anMC0vkA1YCvI4L6MsJhgVWm7hLR1iZN8xGzyUEEwPPPrKmKAWppdQZvCV b5c3wioSX4p/hpZ5Ppb+MLZnfQmjwA== =dnOM -----END PGP SIGNATURE----- --hqu9GGmQSmzk8QQV-- --===============6231877262695501194== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6231877262695501194==--