From patchwork Fri Jun 21 15:28:12 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 13707791
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 A8B80C27C4F
for ;
Fri, 21 Jun 2024 15:28:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help
:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:
Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:
Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender
:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner;
bh=zuRlc7IEeKBSuNeuh4vULjLGZ2xrirIJS5lO/xFvBe0=; b=iUpqeusG8h40qOn0ne9FSMZsle
GYLqtQlNEkJJRuZkaGWJz0Slz1NYDvdb2WvlVNP8BJ7S7PErAeXK1VAZdnDwcsao5p4n8uea23GmP
V8yv4PuR7l6wUm+TqQRSfz+PooLntOJuaCWr5sa5zxAXPPyJDqGaKpc3PWaDZxlgBD4VLwOQxk4sG
6JFttMfMgrx7HKHB56YV/lqpFeH1Mr4NpJpQIn2RbGfIGY+/2NUvIbFq+YXPgickFJHY3Ie4PZuc6
nRMj7akXLpw6UxATAOfv0NnYPTSnVxKooAWxOINSCyC1P8mmKzB/sXOmnWARLFLTvhXAKOkYHjMy1
omsUQyrQ==;
Received: from localhost ([::1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux))
id 1sKgBZ-00000009kQv-26eQ;
Fri, 21 Jun 2024 15:28:21 +0000
Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05])
by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux))
id 1sKgBW-00000009kPf-2GyY
for linux-arm-kernel@bombadil.infradead.org;
Fri, 21 Jun 2024 15:28:18 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=infradead.org; s=desiato.20200630; h=Cc:To:Message-Id:
Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender:
Reply-To:Content-ID:Content-Description:In-Reply-To:References;
bh=zuRlc7IEeKBSuNeuh4vULjLGZ2xrirIJS5lO/xFvBe0=; b=IXp8lh8TjcbAgbHTRINrW8Idwc
VeGZ9klwYaQUJZKX0M21sfT2CuWcLDaEc7GNKl8QV65mIGplKzvjdkkPZH425i7Rs18RHVCm/Yi5J
GPf4SN7rECn/n1kwAJ6Znv0asHexumtD7iSr2/U+41Em0UYuSjDwVOuYDAlxOd61F//b4L5BLwE0C
N9x8phRas6VTm5vPYmEaEQ+3jjIt7ttw3zz/wk4cLyeSRPU3KVZ2OSlk0yy6Khe2OQ0VKIA7ty/jb
9Ek/Zk29v63o+YmwtSKmG/uowEoj0GgrCR/q9z9ObP5yhhJSvHt/ABzY/jT2unr+2RO8JcI8WUg+G
8tqjm4Vw==;
Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104])
by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux))
id 1sKgBS-00000007jAS-3s1X
for linux-arm-kernel@lists.infradead.org;
Fri, 21 Jun 2024 15:28:16 +0000
Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54])
by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92)
(envelope-from )
id 1sKgBR-0000A9-Ek; Fri, 21 Jun 2024 17:28:13 +0200
From: Philipp Zabel
Date: Fri, 21 Jun 2024 17:28:12 +0200
Subject: [PATCH] reset: meson-audio-arb: Use devm_clk_get_enabled()
MIME-Version: 1.0
Message-Id:
<20240621-reset-devm-clk-get-enabled-v1-1-8408c7962b6c@pengutronix.de>
X-B4-Tracking: v=1; b=H4sIAAucdWYC/x3MQQqDMBAF0KvIrDtgpuKiV5EuNPOjgzaWpARBv
HuDy7d5J2UkQ6ZXc1JCsWx7rHCPhvwyxhlsWk3SStf24jgh48eK8mG/rTxXII7TBmXV8Jx6FyB
eqAbfhGDHnQ/v6/oD0qZ/zWwAAAA=
To: Neil Armstrong ,
Kevin Hilman , Jerome Brunet ,
Martin Blumenstingl
Cc: linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel@pengutronix.de,
Philipp Zabel
X-Mailer: b4 0.14-dev
X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::54
X-SA-Exim-Mail-From: p.zabel@pengutronix.de
X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de);
SAEximRunCond expanded to false
X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20240621_162815_246933_C6999061
X-CRM114-Status: GOOD ( 11.09 )
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:
,
Sender: "linux-arm-kernel"
Errors-To:
linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org
Use devm_clk_get_enabled() to reduce a bit of boilerplate and to
disable the clock in case devm_reset_controller_register() fails.
Signed-off-by: Philipp Zabel
Reviewed-by: Jerome Brunet
---
drivers/reset/reset-meson-audio-arb.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
---
base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
change-id: 20240621-reset-devm-clk-get-enabled-ddf3b61fe2c2
Best regards,
diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
index 7891d52fa899..894ad9d37a66 100644
--- a/drivers/reset/reset-meson-audio-arb.c
+++ b/drivers/reset/reset-meson-audio-arb.c
@@ -129,8 +129,6 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
writel(0, arb->regs);
spin_unlock(&arb->lock);
- clk_disable_unprepare(arb->clk);
-
return 0;
}
@@ -150,7 +148,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, arb);
- arb->clk = devm_clk_get(dev, NULL);
+ arb->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(arb->clk))
return dev_err_probe(dev, PTR_ERR(arb->clk), "failed to get clock\n");
@@ -170,11 +168,6 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
* In the initial state, all memory interfaces are disabled
* and the general bit is on
*/
- ret = clk_prepare_enable(arb->clk);
- if (ret) {
- dev_err(dev, "failed to enable arb clock\n");
- return ret;
- }
writel(BIT(ARB_GENERAL_BIT), arb->regs);
/* Register reset controller */