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 26A83C433F5 for ; Tue, 12 Apr 2022 13:25:27 +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=gF2tnQkOf5dbLE0Y9igJuhi0Wp6SKAJgtUwEY2g/ibA=; b=NS9xfkUrH0G5KFZ7WedrN+EwIC d9jOb8syGoF7JjSj9H6lREUoV+l6GVY3qwkD2J9Gq+COBz0EAhnn6GIoGMHvuBvJWINvfSssgncSL IFC6gIujAnHgyjOegKXiVVdPTNxt/5/Pqswi+Sm+oyQCENsCxyOwAWoXz8my3xBS8tJRChIcS4G4/ UK7MXREX+h81zoPAMythk7yQmjnRNPMsg2mWqGalka7hLZRrGJ6d1sD5R9iKsrn8ArkUt3E0QZUPE enYDtZiPnRwzMaK4GmKBJUf7zdEIiNw2gvgu9I+l3MN/Lldpk2fJMwFYFU1qeD7HPxGJv1xQeegUl R16qyzlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neGUk-00EYYs-II; Tue, 12 Apr 2022 13:23:47 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neGUa-00EYSJ-85 for linux-arm-kernel@lists.infradead.org; Tue, 12 Apr 2022 13:23:40 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 816853200D53; Tue, 12 Apr 2022 09:23:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 12 Apr 2022 09:23:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1649769809; x=1649856209; bh=SCBBhq7C9q 0Z6mR7hQqmWZHCx1ZocRttm3x1QobmTTg=; b=QA+HwR/CwtCKhYGOcy9Z1ZwoEP inlBN2ws97HMBG/hMwgNWmPRguDSmiKr0/BZNLpGZUA8q5ZZCuIQ07806K+Nu8wK sFbKZrqUeDstfgwZTC+R4v6zdbx4vlk3ZLRrp50BiJbTKDZcN+5R4ZVMkMytFjC1 j0aRg9WwXSzK6BUX5BBSlPccQb7upozo37NR6jADtIuiCrT/MDR8rq3sRjYQ81Da jVt9cJTzhOhyjoIaKbmAA6hWnYpIjqYvhyN5SNZ8ZY5Q18bozkYlKQpzAjAMOutM b6lWyAhYUXat95dTmFq0KxIGGxhb/UYp2ngsxEe2SxxR14VDQS6omEEcYDTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1649769809; x= 1649856209; bh=SCBBhq7C9q0Z6mR7hQqmWZHCx1ZocRttm3x1QobmTTg=; b=e XPnv5AadguhgwzimhsdMBgjPMrSYdpp+TnjGKJ4FJw+68TnBXeDKp1wbAPQhwJrg K/C7vrPZq2y6WiPh1geWoz8vSpJGyL1qFCezZ9ULBCyrnE3juylOkeuPXZkueFLi SBbUrb3o4BxGDlAMsGG+RB5pwzrqpXOTNgt8cMkhVT/BAiZMAJwkbQP+fEE6Qz59 ZqrKt1mbCiKLFOqx153EnIupjOT+iU+yK1ThDi7GJ5WAJr3P7aJ+OFXaRvBRf+ED qceJbixeumR4D7sPffWhD2bcwhTi2OGVv0Da1w0dKLouFLZ3uymsTE5NvD99FxoU O9UiIrisktUT7HPhd0DNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekkedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 09:23:27 -0400 (EDT) Date: Tue, 12 Apr 2022 15:23:25 +0200 From: Maxime Ripard To: Samuel Holland Cc: Chen-Yu Tsai , Jernej Skrabec , Daniel Vetter , David Airlie , Philipp Zabel , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 3/6] drm/sun4i: sun8i-hdmi-phy: Used device-managed clocks/resets Message-ID: <20220412132325.bq2c3g2fskckfgpz@houat> References: <20220412043512.49364-1-samuel@sholland.org> <20220412043512.49364-4-samuel@sholland.org> MIME-Version: 1.0 In-Reply-To: <20220412043512.49364-4-samuel@sholland.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220412_062338_498969_A98EFCEC X-CRM114-Status: GOOD ( 20.72 ) 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="===============9115089354737819137==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============9115089354737819137== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="542vfuzlbowtb4mg" Content-Disposition: inline --542vfuzlbowtb4mg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Apr 11, 2022 at 11:35:08PM -0500, Samuel Holland wrote: > Now that the HDMI PHY is using a platform driver, it can use device- > managed resources. Use these, as well as the dev_err_probe helper, to > simplify the probe function and get rid of the remove function. >=20 > Signed-off-by: Samuel Holland > --- >=20 > drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c | 100 ++++++++----------------- > 1 file changed, 30 insertions(+), 70 deletions(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun= 4i/sun8i_hdmi_phy.c > index 1effa30bfe62..1351e633d485 100644 > --- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c > +++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c > @@ -673,10 +673,8 @@ int sun8i_hdmi_phy_get(struct sun8i_dw_hdmi *hdmi, s= truct device_node *node) > static int sun8i_hdmi_phy_probe(struct platform_device *pdev) > { > struct device *dev =3D &pdev->dev; > - struct device_node *node =3D dev->of_node; > struct sun8i_hdmi_phy *phy; > void __iomem *regs; > - int ret; > =20 > phy =3D devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); > if (!phy) > @@ -686,88 +684,50 @@ static int sun8i_hdmi_phy_probe(struct platform_dev= ice *pdev) > phy->dev =3D dev; > =20 > regs =3D devm_platform_ioremap_resource(pdev, 0); > - if (IS_ERR(regs)) { > - dev_err(dev, "Couldn't map the HDMI PHY registers\n"); > - return PTR_ERR(regs); > - } > + if (IS_ERR(regs)) > + return dev_err_probe(dev, PTR_ERR(regs), > + "Couldn't map the HDMI PHY registers\n"); > =20 > phy->regs =3D devm_regmap_init_mmio(dev, regs, > &sun8i_hdmi_phy_regmap_config); > - if (IS_ERR(phy->regs)) { > - dev_err(dev, "Couldn't create the HDMI PHY regmap\n"); > - return PTR_ERR(phy->regs); > - } > + if (IS_ERR(phy->regs)) > + return dev_err_probe(dev, PTR_ERR(phy->regs), > + "Couldn't create the HDMI PHY regmap\n"); > =20 > - phy->clk_bus =3D of_clk_get_by_name(node, "bus"); > - if (IS_ERR(phy->clk_bus)) { > - dev_err(dev, "Could not get bus clock\n"); > - return PTR_ERR(phy->clk_bus); > - } > - > - phy->clk_mod =3D of_clk_get_by_name(node, "mod"); > - if (IS_ERR(phy->clk_mod)) { > - dev_err(dev, "Could not get mod clock\n"); > - ret =3D PTR_ERR(phy->clk_mod); > - goto err_put_clk_bus; > - } > + phy->clk_bus =3D devm_clk_get(dev, "bus"); > + if (IS_ERR(phy->clk_bus)) > + return dev_err_probe(dev, PTR_ERR(phy->clk_bus), > + "Could not get bus clock\n"); > =20 > - if (phy->variant->has_phy_clk) { > - phy->clk_pll0 =3D of_clk_get_by_name(node, "pll-0"); > - if (IS_ERR(phy->clk_pll0)) { > - dev_err(dev, "Could not get pll-0 clock\n"); > - ret =3D PTR_ERR(phy->clk_pll0); > - goto err_put_clk_mod; > - } > - > - if (phy->variant->has_second_pll) { > - phy->clk_pll1 =3D of_clk_get_by_name(node, "pll-1"); > - if (IS_ERR(phy->clk_pll1)) { > - dev_err(dev, "Could not get pll-1 clock\n"); > - ret =3D PTR_ERR(phy->clk_pll1); > - goto err_put_clk_pll0; > - } > - } > - } > + phy->clk_mod =3D devm_clk_get(dev, "mod"); > + if (IS_ERR(phy->clk_mod)) > + return dev_err_probe(dev, PTR_ERR(phy->clk_mod), > + "Could not get mod clock\n"); > =20 > - phy->rst_phy =3D of_reset_control_get_shared(node, "phy"); > - if (IS_ERR(phy->rst_phy)) { > - dev_err(dev, "Could not get phy reset control\n"); > - ret =3D PTR_ERR(phy->rst_phy); > - goto err_put_clk_pll1; > - } > + if (phy->variant->has_phy_clk) > + phy->clk_pll0 =3D devm_clk_get(dev, "pll-0"); > + if (IS_ERR(phy->clk_pll0)) > + return dev_err_probe(dev, PTR_ERR(phy->clk_pll0), > + "Could not get pll-0 clock\n"); > + > + if (phy->variant->has_second_pll) > + phy->clk_pll1 =3D devm_clk_get(dev, "pll-1"); > + if (IS_ERR(phy->clk_pll1)) > + return dev_err_probe(dev, PTR_ERR(phy->clk_pll1), > + "Could not get pll-1 clock\n"); > + > + phy->rst_phy =3D devm_reset_control_get_shared(dev, "phy"); > + if (IS_ERR(phy->rst_phy)) > + return dev_err_probe(dev, PTR_ERR(phy->rst_phy), > + "Could not get phy reset control\n"); I find the old construct clearer with the imbricated blocks. Otherwise, the rest of the series looks fine, thanks! Maxime --542vfuzlbowtb4mg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYlV9TQAKCRDj7w1vZxhR xXz3AQCLd+iM9nW9TMjH67uErKUxeCFePEosuu47NlHJp2MjHQD/dC1dKOtp1lTu FRHk3m7R4Cr2sMERznd+wOMkOdpzjQk= =f6v7 -----END PGP SIGNATURE----- --542vfuzlbowtb4mg-- --===============9115089354737819137== 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 --===============9115089354737819137==--