From patchwork Fri May 20 07:57:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12856442 X-Patchwork-Delegate: neil.armstrong@linaro.org 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 60BB3C433FE for ; Fri, 20 May 2022 07:58:26 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xmSjxZVCAdKQzstKhSyzJzu1C4PdVgXeIO+AvoIYCws=; b=0ZU1yfv4TqUa+s ZfJl8SV/0BWuTDMkoroUftiOUhR5sIux3qnEtupFPJixYu/RzgHePGiaQrl3g0zTnHC0YcKGUUZR3 7ZDjU/ajBr5wWGzoTxdbMAQJwq3tofaKfJtkSQ40EdKxXH4HYBvoSDYqu8ex8AJ8cNSMpfUBbnJks sqH3C6gAVUjDKB2CRoJL4Qtmq4LZB+Xw3HHtky7HmTNz7LxcpZBj/XJRoxJF/NOze+hx3CUON0IKe QQznsMaWyWh/jpBWU/eb6rdQOMYrqerpGjnH7sEdrlmyYEWjM2MMioDY+DAIw2ffwI3CdPrCSvahT 9obQcIZIjxC/FQeTCHRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrxWf-00BAE7-5Y; Fri, 20 May 2022 07:58:21 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrxWc-00BACJ-59 for linux-amlogic@lists.infradead.org; Fri, 20 May 2022 07:58:19 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrxWI-0006bJ-3L; Fri, 20 May 2022 09:57:58 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nrxWH-003RP0-VN; Fri, 20 May 2022 09:57:56 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nrxWF-00Avea-Ti; Fri, 20 May 2022 09:57:55 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Russell King , Stephen Boyd Cc: linux-clk@vger.kernel.org, kernel@pengutronix.de, Michael Turquette , Jonathan Cameron , Alexandru Ardelean , Neil Armstrong , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , linux-amlogic@lists.infradead.org Subject: [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() Date: Fri, 20 May 2022 09:57:37 +0200 Message-Id: <20220520075737.758761-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220520075737.758761-1-u.kleine-koenig@pengutronix.de> References: <20220520075737.758761-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1895; h=from:subject; bh=emep3XTkeTU0GpA6wJdvDAVmYPRGFjZLqCqv5c74cSE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBih0nqFtRg24pg7iF4i0BIc3b62DZbS0YtPVV+6mw8 mTbF7qmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYodJ6gAKCRDB/BR4rcrsCYLpB/ 91Ah3ys+uVCA3xVXezxTZAjAHX5LK2RJgoLEEz0GbNNL44wWlYFBRErQO/r3KnOU9lsaRDpstCBZ6E E3jpb025VuPXKQR59SOMXhkHRclNY6Vm1xLlT3thqs4yU55BuoLkHm6k23EkzvMc6APn8kXV8pzCai hiQEcbLzzWm42ehymmL39l4VW4dRYoz2xNmSiZEcT3JB1SP/ja3SjmHzjWKlb9IR216d2mjiZT0QZp WP7m8cla/i9IZ5SqyZg/zIn26pv5cGTb5yaDKiOLQR9ISfVyfZFa8/zhwYczzr+Fa0Rhsks7/ayIvc BTqxJa4Q/Ymo7DxBS+1tEUT0qfF+lW X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-amlogic@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220520_005818_231684_31F2D21E X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The clk API just got a function with a slightly different name and the same functionality. Remove the duplication. Signed-off-by: Uwe Kleine-König --- drivers/clk/meson/axg-audio.c | 36 ++++------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c index bfe36bd41339..5016682e47c8 100644 --- a/drivers/clk/meson/axg-audio.c +++ b/drivers/clk/meson/axg-audio.c @@ -1657,35 +1657,6 @@ static struct clk_regmap *const sm1_clk_regmaps[] = { &sm1_sysclk_b_en, }; -static int devm_clk_get_enable(struct device *dev, char *id) -{ - struct clk *clk; - int ret; - - clk = devm_clk_get(dev, id); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - dev_err_probe(dev, ret, "failed to get %s", id); - return ret; - } - - ret = clk_prepare_enable(clk); - if (ret) { - dev_err(dev, "failed to enable %s", id); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - clk); - if (ret) { - dev_err(dev, "failed to add reset action on %s", id); - return ret; - } - - return 0; -} - struct axg_audio_reset_data { struct reset_controller_dev rstc; struct regmap *map; @@ -1787,6 +1758,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) struct regmap *map; void __iomem *regs; struct clk_hw *hw; + struct clk *clk; int ret, i; data = of_device_get_match_data(dev); @@ -1804,9 +1776,9 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) } /* Get the mandatory peripheral clock */ - ret = devm_clk_get_enable(dev, "pclk"); - if (ret) - return ret; + clk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(clk)) + return PTR_ERR(clk); ret = device_reset(dev); if (ret) {