From patchwork Sun Jun 11 22:56:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 691544 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CED9BC7EE23 for ; Sun, 11 Jun 2023 23:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232878AbjFKXhQ (ORCPT ); Sun, 11 Jun 2023 19:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232654AbjFKXhG (ORCPT ); Sun, 11 Jun 2023 19:37:06 -0400 X-Greylist: delayed 1784 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 11 Jun 2023 16:36:52 PDT Received: from 4.mo581.mail-out.ovh.net (4.mo581.mail-out.ovh.net [178.32.122.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C02139 for ; Sun, 11 Jun 2023 16:36:51 -0700 (PDT) Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.146.76]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 976A823020 for ; Sun, 11 Jun 2023 22:57:50 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-bqp6v (unknown [10.110.103.167]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E938F1FDE9; Sun, 11 Jun 2023 22:57:49 +0000 (UTC) Received: from etezian.org ([37.59.142.98]) by ghost-submission-6684bf9d7b-bqp6v with ESMTPSA id tS+9Mm1RhmRl3Q8A2le5ag (envelope-from ); Sun, 11 Jun 2023 22:57:49 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R00296a076f8-0597-48ea-a108-55ad6848b1fa, CC7C3CD7EA035B6EDB7D18A077CE8F666EF926BD) smtp.auth=andi@etezian.org X-OVh-ClientIp: 93.66.31.89 From: Andi Shyti To: Linux I2C Cc: Andi Shyti , Codrin Ciubotariu , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Subject: [PATCH 03/15] i2c: busses: at91-core: Use devm_clk_get_enabled() Date: Mon, 12 Jun 2023 00:56:50 +0200 Message-Id: <20230611225702.891856-4-andi.shyti@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230611225702.891856-1-andi.shyti@kernel.org> References: <20230611225702.891856-1-andi.shyti@kernel.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 5867627367089572552 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrgedufedgudehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehnughiucfuhhihthhiuceorghnughirdhshhihthhisehkvghrnhgvlhdrohhrgheqnecuggftrfgrthhtvghrnhepgfduveejteegteelhfetueetheegfeehhfektddvleehtefhheevkeduleeuueevnecukfhppeduvdejrddtrddtrddupdelfedrieeirdefuddrkeelpdefjedrheelrddugedvrdelkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoegrnhguihesvghtvgiiihgrnhdrohhrgheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqihdvtgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekuddpmhhouggvpehsmhhtphhouhht Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Cc: Codrin Ciubotariu Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Acked-by: Nicolas Ferre --- drivers/i2c/busses/i2c-at91-core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index 05ad3bc3578ac..2251e0deed29c 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -226,12 +226,11 @@ static int at91_twi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dev); - dev->clk = devm_clk_get(dev->dev, NULL); + dev->clk = devm_clk_get_enabled(dev->dev, NULL); if (IS_ERR(dev->clk)) { - dev_err(dev->dev, "no clock defined\n"); + dev_err(dev->dev, "failed to enable clock\n"); return -ENODEV; } - clk_prepare_enable(dev->clk); snprintf(dev->adapter.name, sizeof(dev->adapter.name), "AT91"); i2c_set_adapdata(&dev->adapter, dev); @@ -260,8 +259,6 @@ static int at91_twi_probe(struct platform_device *pdev) rc = i2c_add_numbered_adapter(&dev->adapter); if (rc) { - clk_disable_unprepare(dev->clk); - pm_runtime_disable(dev->dev); pm_runtime_set_suspended(dev->dev); @@ -278,7 +275,6 @@ static void at91_twi_remove(struct platform_device *pdev) struct at91_twi_dev *dev = platform_get_drvdata(pdev); i2c_del_adapter(&dev->adapter); - clk_disable_unprepare(dev->clk); pm_runtime_disable(dev->dev); pm_runtime_set_suspended(dev->dev);