From patchwork Sun Mar 10 13:47:20 2024 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: 13588127 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 70C9CC54E58 for ; Sun, 10 Mar 2024 13:48:00 +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=+lejULq9q8QfdipiiUmf8ChYlQ28BLd5rR1PzLcFEtU=; b=m2tA3IOvNezYBP U6Mtt5vqQNB89dlt/abtMRH2dWruZU1fcZSEXDd6W6M7F67haaaKbdaRneAHqZiHIORke3qay46lM 0IU9DZYrbS30oWmFF7WVerD9BKpjNdHjMlTMme1dqNy+1VOOdgaphqaus3D7Hex2NcqvWBQNIwd7K tVLgeFwwgLpVJaA9zS+6uHRpfNC7uENOYQ9X62z/iA90uVkjhDYyemvLTEX3BzOTULvuxZ6duJT4L oCtuxaWgCIoNRlTG4U1XQg2U3dKt3a0YMziRrZJySm/IoEz1+/Ey7h6d459UpJuPQgO9FO+xxRFr5 RLt/z7w1uW+/7msifn/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjJWi-0000000FsZT-1Dnz; Sun, 10 Mar 2024 13:47:44 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjJWd-0000000FsXT-1Kte for linux-arm-kernel@lists.infradead.org; Sun, 10 Mar 2024 13:47:41 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rjJWY-0000zS-Hz; Sun, 10 Mar 2024 14:47:34 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjJWY-005WrM-5F; Sun, 10 Mar 2024 14:47:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rjJWY-003SKC-0E; Sun, 10 Mar 2024 14:47:34 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Florian Fainelli , Ray Jui , Scott Branden Cc: Broadcom internal kernel review list , linux-pwm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 2/2] pwm: bcm2835: Drop open coded variant of devm_clk_rate_exclusive_get() Date: Sun, 10 Mar 2024 14:47:20 +0100 Message-ID: <8e1a5151a7bcd455996c873bb3d13ab86def3490.1710078146.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1472; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=79AmYYZEOLbzvbNiEIIV8+diN3zkJyqKVCdZ4iuPKdU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl7bnrmLEyB+GTwBPINh8dcmnkHqGw5+Zd/jTs4 cHZN1/kvyWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZe256wAKCRCPgPtYfRL+ Tjw6CACdSW2/oqMiil35Ct2BPwBxq3vQ9/ihg0LsM6L0MzzZLnj2Il8lBgyORX2peNbWFGF81gE ttppqD01XO6sNlq8tR06RieweKXpBX5RGR04QL9+6p/TqONzTl4bl9ansGLmwDv1E+cy74zBtot roNFXz1yD90c1hsITRmucRONsNqGQRcvlvdA39dijiUHIt9i69ofzfgtf03QACwdj1N5SDBWv+D /obKJM8Vy5l7KcFOggyA3ug9kQGnumrcgSvtRth8fd6Sf4P7n6oQkFqQJHnUiVCi+efZSGpnLI5 IiHo++qviX4hQgRGswJCPZRDNpLdLVVDIStAZgRAm4JUXm46 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.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-20240310_064739_416393_07FFF20C X-CRM114-Status: GOOD ( 13.08 ) 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 Since commit b0cde62e4c54 ("clk: Add a devm variant of clk_rate_exclusive_get()") the clk subsystem provides devm_clk_rate_exclusive_get(). Replace the open coded implementation by the new function. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli --- drivers/pwm/pwm-bcm2835.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c index 3d0c089c9ef0..578e95e0296c 100644 --- a/drivers/pwm/pwm-bcm2835.c +++ b/drivers/pwm/pwm-bcm2835.c @@ -124,13 +124,6 @@ static const struct pwm_ops bcm2835_pwm_ops = { .apply = bcm2835_pwm_apply, }; -static void devm_clk_rate_exclusive_put(void *data) -{ - struct clk *clk = data; - - clk_rate_exclusive_put(clk); -} - static int bcm2835_pwm_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -152,16 +145,11 @@ static int bcm2835_pwm_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(pc->clk), "clock not found\n"); - ret = clk_rate_exclusive_get(pc->clk); + ret = devm_clk_rate_exclusive_get(dev, pc->clk); if (ret) return dev_err_probe(dev, ret, "fail to get exclusive rate\n"); - ret = devm_add_action_or_reset(dev, devm_clk_rate_exclusive_put, - pc->clk); - if (ret) - return ret; - pc->rate = clk_get_rate(pc->clk); if (!pc->rate) return dev_err_probe(dev, -EINVAL,