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 AC7F7C32772 for ; Tue, 23 Aug 2022 12:17:31 +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=pfRge8mNNKV1F9xHwVkXl8aglrZkoROB47nGif4PjaE=; b=bRSUOjIGn5hLCVAexL4LfLJTpl /Zeo5CpIj7TI+54mRj873q/iIzg57wdC2UnaZW2nz8kFzdON9V1sobwPdLDXDfK6bTv3pjVMVgaqz JZLHSuKyzWUcI4agn//eAwt5nxlaRMHSpIUFEOPv7MWByk2pTi3BbTTa5+faA0voNyS8Y+8ATxtR7 halg3+HzQ5fQe81cQ0jro8DS3kFI2p6Er7K/4w+p8q8ScGZZuoFM/W19E1VUG1ZmcpaH0KK8gCcCQ 6+8ketuWcPjnErkp/39azPaCmWsaLCc6Tb1NAYbfFmBOeP0h413E4+XI6XEVE/bmH4RXXipnWxeU8 qG1ii+ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQSpR-005lUi-Kk; Tue, 23 Aug 2022 12:16:31 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQSpK-005lQS-5C for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2022 12:16:16 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DDF0440008; Tue, 23 Aug 2022 12:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1661256969; 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=etPKwelbA+tTlRYYdrHTtYLe08SrSj0mjH5eb5hJOEo=; b=EcLUICxWmL3GxUpjFUhfExprDuK1skDWZXJGnScRsI6HP5ULN2w9+NZ8YMIS9OFyq/l94X shMqLJqioe+hY3441wZ4QTVwjqRjFdwWr9Vv/Gd9Qc1T4kM9/rLAY2R0RmQg+oeQq+Ter/ Y88/CaLJeYMRh5rd5yQPjCr1PaLx2uyHyYvpmwPiAkAXQjIFEbuAktxWMAGIRM23DT4rwG 91iZbgFnhaxeKfnRITkx7SMYg+Xs7ASb4+D+jGKUi6J4CQOLpi7nUVb/K04btf4wRUm4wK a2rF4snOc8bHl3/TcUdGIN4MJ5GZ0qoPaon1LQapBpjxtYKMbllBBIr5HGODoQ== Date: Tue, 23 Aug 2022 14:16:02 +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 v2 2/2] media: sunxi: Fix some error handling path of sun6i_mipi_csi2_probe() Message-ID: References: <28d04b260acff7eb4416a410d5678cbafb5e2784.1661240416.git.christophe.jaillet@wanadoo.fr> <69f418936bf0060287d237824a677192343b91ab.1661240416.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 In-Reply-To: <69f418936bf0060287d237824a677192343b91ab.1661240416.git.christophe.jaillet@wanadoo.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220823_051614_486178_A7EAD903 X-CRM114-Status: GOOD ( 21.47 ) 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="===============0494259937714115352==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0494259937714115352== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aPxKs6zDsOLiGtPt" Content-Disposition: inline --aPxKs6zDsOLiGtPt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Christophe, On Tue 23 Aug 22, 09:42, 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. Looks good to me, thanks! Acked-by: Paul Kocialkowski Cheers, Paul =20 > Fixes: af54b4f4c17f ("media: sunxi: Add support for the A31 MIPI CSI-2 co= ntroller") > Signed-off-by: Christophe JAILLET > --- > Changes in v2: > * add some blank line [Paul Kocialkowski ] > * rename the new labels [Paul Kocialkowski ] >=20 > v1: > https://lore.kernel.org/all/9999a30560d0ab8201734cbab0483c6f840402da.16= 59295329.git.christophe.jaillet@wanadoo.fr/ > --- > .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 20 +++++++++++++++---- > 1 file changed, 16 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..30d6c0c5161f 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 error_clock_rate_exclusive; > } > =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 error_clock_rate_exclusive; > } > =20 > ret =3D phy_init(csi2_dev->dphy); > if (ret) { > dev_err(dev, "failed to initialize MIPI D-PHY\n"); > - return ret; > + goto error_clock_rate_exclusive; > } > =20 > /* Runtime PM */ > @@ -683,6 +685,11 @@ sun6i_mipi_csi2_resources_setup(struct sun6i_mipi_cs= i2_device *csi2_dev, > pm_runtime_enable(dev); > =20 > return 0; > + > +error_clock_rate_exclusive: > + clk_rate_exclusive_put(csi2_dev->clock_mod); > + > + return ret; > } > =20 > static void > @@ -712,9 +719,14 @@ 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 error_resources; > =20 > return 0; > + > +error_resources: > + sun6i_mipi_csi2_resources_cleanup(csi2_dev); > + > + 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 --aPxKs6zDsOLiGtPt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmMExQIACgkQ3cLmz3+f v9HgnAf+NpBFcCGKtldzFOK2iXMmRJoDixDIpBBvqdDqGMnyn7JII4kfn+kGbUhI ScdBPKYWdj5cJ2QRawxmQsQccXjq7ixywdrroxJqScfsRJosWsVXVGz0XngrFEuB JoF4MyLo63l63X0ht9fVgpkxHr2uMDfdUXMyxCY123Fd1JuarllEWmZlMks5gPTW B1aKYEu5izRREnLf/PEnf6Y1HNYJyg5tbyDy2MGP/0cp3REfdn8ss4l2T1Z1/A2a YE+2XzZwi8ck4yrmSJgYBLPdqDuM0oLrW8R5L+Qm0qArVlRVwB+ryc3bDHPjPoRA pIj3Mc/xpvAVXgBZKIh+bBR/neqPHg== =Q5/R -----END PGP SIGNATURE----- --aPxKs6zDsOLiGtPt-- --===============0494259937714115352== 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 --===============0494259937714115352==--