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 0CD6BC00140 for ; Fri, 5 Aug 2022 14:13:24 +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=dmP+2ees0c9Nz9ZmK4Sb3p9IxlRogOKoEN4cBHoWzSo=; b=2JlHbzAUYfTB/LviOIRSjsN1MR 3xEsVdLqYeMem7BMdqaT46rWAFCQdl/d7L35x1ZGpqO4DZsdJQayBWd6qlZ5PZ33CRUu2+086lJJ8 YsW7brDsCtSNBFpUHxNH78hRkThPNJyOL/jkT1RbJLVZ2Jsy/GQ8sKW4RqTI6rFkse6UH8D93UjwB ghOqy2lwOWya+syhYsVUD+mDqOhc8dJlUi7SBn1k+8lPTtnapzgKJqyyjqj+Wzo2+DZuymgfjTtWY XOXHaQhTs9NVwZoDZufoRU0ugXDK1xA5Bn5PkHCbmyLLPQjt7gcXXek8zufBn+Ri6nCVuDccbU4WH ExULJPqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJy3j-00Fk9E-20; Fri, 05 Aug 2022 14:12:15 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJy3I-00FjnY-4f for linux-arm-kernel@lists.infradead.org; Fri, 05 Aug 2022 14:11:50 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 1EE0CFF805; Fri, 5 Aug 2022 14:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1659708704; 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=u2noyRzn5oYWYwmIMBH9uFDA4P12nprNL0SehkpX2g0=; b=ls6MZAjPDMN8Jaa8rk8L36zOyS6t+bADzZqUNsQF2WBt+1H+uZ7ZxFZkTbfDLUznKDwKut tbZR3QCTXZJJTq7kab77a0zsEtW1xOJU5jEO5wR5+TC8I9V+MTzQC38eAQzqiy/vcVNO0h jwvjEOxCWjfP13j2ykihmJ0bLP77e3myOZYEvV7kODe/sRWFhYcoE6ET4WIk9jQGmA92Xw UKRbkIklzNOccHmLFCg/bloroIkuWAfMXu/LA7vtHC7EgKHzd7uKBKMvwesNO2PFhzAhqu CD2ces9mAXDxVX+g08PXyVpyERBCt3+hdOTcAjNigtGOrwk9pkH552unpeI0Kg== Date: Fri, 5 Aug 2022 16:11:41 +0200 From: Paul Kocialkowski To: Christophe JAILLET Cc: Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Hans Verkuil , Maxime Ripard , 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 2/2] media: sunxi: Fix some error handling path of sun6i_mipi_csi2_probe() Message-ID: References: <62c0aef8d3b86d8f290bf6787f1b2b41efbb0b55.1659295329.git.christophe.jaillet@wanadoo.fr> <9999a30560d0ab8201734cbab0483c6f840402da.1659295329.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 In-Reply-To: <9999a30560d0ab8201734cbab0483c6f840402da.1659295329.git.christophe.jaillet@wanadoo.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_071148_545830_C8722F9C X-CRM114-Status: GOOD ( 22.05 ) 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="===============8163626706282483629==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8163626706282483629== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6hGXz6ToMr4OxfZM" Content-Disposition: inline --6hGXz6ToMr4OxfZM 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 > sun6i_mipi_csi2_resources_setup(), as already done in the remove > function. Thanks again, my comments are the same as in the other patch! > Fixes: af54b4f4c17f ("media: sunxi: Add support for the A31 MIPI CSI-2 co= ntroller") > Signed-off-by: Christophe JAILLET > --- > .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2= =2Ec b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c > index a4e3f9a6b2ff..1ee8501e25f6 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 > @@ -661,7 +661,8 @@ sun6i_mipi_csi2_resources_setup(struct sun6i_mipi_csi= 2_device *csi2_dev, > 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 */ > @@ -669,13 +670,14 @@ sun6i_mipi_csi2_resources_setup(struct sun6i_mipi_c= si2_device *csi2_dev, > csi2_dev->dphy =3D devm_phy_get(dev, "dphy"); > if (IS_ERR(csi2_dev->dphy)) { > dev_err(dev, "failed to get MIPI D-PHY\n"); > - return PTR_ERR(csi2_dev->dphy); > + ret =3D PTR_ERR(csi2_dev->dphy); > + goto err_put_clk_rate; > } > =20 > ret =3D phy_init(csi2_dev->dphy); > if (ret) { > dev_err(dev, "failed to initialize MIPI D-PHY\n"); > - return ret; > + goto err_put_clk_rate; > } > =20 > /* Runtime PM */ > @@ -683,6 +685,10 @@ sun6i_mipi_csi2_resources_setup(struct sun6i_mipi_cs= i2_device *csi2_dev, > 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 > @@ -712,9 +718,13 @@ static int sun6i_mipi_csi2_probe(struct platform_dev= ice *platform_dev) > =20 > ret =3D sun6i_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", > + sun6i_mipi_csi2_resources_cleanup(csi2_dev); and add a blank line here. Thanks, Paul > + return ret; > } > =20 > static int sun6i_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 --6hGXz6ToMr4OxfZM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmLtJR0ACgkQ3cLmz3+f v9HtuAgAjbJFqp2zBhPvBdeCo2uWchkhpw5Kne+JeEllzzEEjA82pkxkJA+Ir6kY CFHskoQgJTwR48dcvxEVXfKeFuhUxIsqWPn/ip+E2OnSeYx20VtceL1YwTEF/zCN Gd/tvy4nlAgkGxUpifiXVeoQb/FIJFb87UO+btc/le3xo903O8vJ6mMFUP2nR+3w rQDf2lc9t6LZldJVGm2fB7mht6KRIu8ytw4ym291tn1dKNlfzpZDr+nsMl6lqfzM FeVSgMc7tiZy+/jYMI1vpXnGirgsjUB3qsW0im1zpcR8LGjDRTaDHx6EvXn4DF1f Dm2Ak2aYs6juTAHdxVOJ4aUJyLIGJQ== =xPvq -----END PGP SIGNATURE----- --6hGXz6ToMr4OxfZM-- --===============8163626706282483629== 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 --===============8163626706282483629==--