Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760750AbbKUNkX (ORCPT ); Sat, 21 Nov 2015 08:40:23 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:42058 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758649AbbKUNkV (ORCPT ); Sat, 21 Nov 2015 08:40:21 -0500 Date: Sat, 21 Nov 2015 13:39:49 +0000 From: Mark Brown To: Leilk Liu Cc: Mark Rutland , Matthias Brugger , Sascha Hauer , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-mediatek@lists.infradead.org Message-ID: <20151121133949.GH26072@sirena.org.uk> References: <1447986080-31410-1-git-send-email-leilk.liu@mediatek.com> <1447986080-31410-4-git-send-email-leilk.liu@mediatek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wj9ZLJVQDRFjGSdK" Content-Disposition: inline In-Reply-To: <1447986080-31410-4-git-send-email-leilk.liu@mediatek.com> X-Cookie: Your domestic life may be harmonious. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 92.40.248.95 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 4/4] spi: mediatek: revise mtk_spi_probe() failure flow X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3323 Lines: 105 --wj9ZLJVQDRFjGSdK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 20, 2015 at 10:21:19AM +0800, Leilk Liu wrote: > This patch revises failure flow while pm_runtime_enable(). Why? This also doesn't apply against current code, please check and resend. >=20 > Signed-off-by: Leilk Liu > --- > drivers/spi/spi-mt65xx.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c > index 6c1a96e..00a36da 100644 > --- a/drivers/spi/spi-mt65xx.c > +++ b/drivers/spi/spi-mt65xx.c > @@ -607,7 +607,8 @@ static int mtk_spi_probe(struct platform_device *pdev) > ret =3D clk_set_parent(mdata->sel_clk, mdata->parent_clk); > if (ret < 0) { > dev_err(&pdev->dev, "failed to clk_set_parent (%d)\n", ret); > - goto err_disable_clk; > + clk_disable_unprepare(mdata->spi_clk); > + goto err_put_master; > } > =20 > clk_disable_unprepare(mdata->spi_clk); > @@ -617,7 +618,7 @@ static int mtk_spi_probe(struct platform_device *pdev) > ret =3D devm_spi_register_master(&pdev->dev, master); > if (ret) { > dev_err(&pdev->dev, "failed to register master (%d)\n", ret); > - goto err_put_master; > + goto err_disable_runtime_pm; > } > =20 > if (mdata->dev_comp->need_pad_sel) { > @@ -626,14 +627,14 @@ static int mtk_spi_probe(struct platform_device *pd= ev) > "pad_num does not match num_chipselect(%d !=3D %d)\n", > mdata->pad_num, master->num_chipselect); > ret =3D -EINVAL; > - goto err_put_master; > + goto err_disable_runtime_pm; > } > =20 > if (!master->cs_gpios && master->num_chipselect > 1) { > dev_err(&pdev->dev, > "cs_gpios not specified and num_chipselect > 1\n"); > ret =3D -EINVAL; > - goto err_put_master; > + goto err_disable_runtime_pm; > } > =20 > if (master->cs_gpios) { > @@ -644,7 +645,7 @@ static int mtk_spi_probe(struct platform_device *pdev) > if (ret) { > dev_err(&pdev->dev, > "can't get CS GPIO %i\n", i); > - goto err_put_master; > + goto err_disable_runtime_pm; > } > } > } > @@ -652,8 +653,8 @@ static int mtk_spi_probe(struct platform_device *pdev) > =20 > return 0; > =20 > -err_disable_clk: > - clk_disable_unprepare(mdata->spi_clk); > +err_disable_runtime_pm: > + pm_runtime_disable(&pdev->dev); > err_put_master: > spi_master_put(master); > =20 > --=20 > 1.7.9.5 >=20 >=20 --wj9ZLJVQDRFjGSdK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWUHQkAAoJECTWi3JdVIfQSsUH/AnNrjAk7MIE5hqdC45N4xlv UOL601EK5SBi7xIDZDwzE8BQXcfneUIU33QB7rHlq2gLhBpRcHO3Z6pe7j7y1RbP hniqeHCzepC+dsJnZSfNvIQYyC1fgJS2DgKdOCWk51Z4LZqMnrujihptvKhgSRJu qG9XyahXjcbTlFqrrLLMQXWw2tGeOAQC036ZtTNKrijMDA+5ZAAG1SzIWbsv05KK lJcVoT+5ThbQIPdL0YQcT/96fWJSftMXC094NknvGn7zmodCSn8U4gSJd9G80Oaw h3P1/5mt/5AmPb1obt0CDWEfrfsyoAjeY/NxiPwnm75UVyJ1YsGHjEjT1a9Rqv4= =9yNe -----END PGP SIGNATURE----- --wj9ZLJVQDRFjGSdK-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/