From patchwork Sun Jun 11 22:56:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 692337 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 B68E2C7EE2E for ; Sun, 11 Jun 2023 23:06:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbjFKXGi (ORCPT ); Sun, 11 Jun 2023 19:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjFKXGh (ORCPT ); Sun, 11 Jun 2023 19:06:37 -0400 X-Greylist: delayed 525 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 11 Jun 2023 16:06:35 PDT Received: from 15.mo582.mail-out.ovh.net (15.mo582.mail-out.ovh.net [188.165.39.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A8A7E47 for ; Sun, 11 Jun 2023 16:06:35 -0700 (PDT) Received: from director3.ghost.mail-out.ovh.net (unknown [10.108.16.251]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 8464723D68 for ; Sun, 11 Jun 2023 22:57:54 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-t8tzp (unknown [10.110.208.112]) by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 4BBCF1FDB7; Sun, 11 Jun 2023 22:57:54 +0000 (UTC) Received: from etezian.org ([37.59.142.110]) by ghost-submission-6684bf9d7b-t8tzp with ESMTPSA id PSsIEXJRhmSd5AMAZZgHpQ (envelope-from ); Sun, 11 Jun 2023 22:57:54 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S004398a087b-c0d8-476b-b996-4b66e0b5cc12, CC7C3CD7EA035B6EDB7D18A077CE8F666EF926BD) smtp.auth=andi@etezian.org X-OVh-ClientIp: 93.66.31.89 From: Andi Shyti To: Linux I2C Cc: Andi Shyti Subject: [PATCH 05/15] i2c: busses: hix5hd2: Use devm_clk_get_enabled() Date: Mon, 12 Jun 2023 00:56:52 +0200 Message-Id: <20230611225702.891856-6-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: 5868753268240026183 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrgedufedgudehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehnughiucfuhhihthhiuceorghnughirdhshhihthhisehkvghrnhgvlhdrohhrgheqnecuggftrfgrthhtvghrnhepgfduveejteegteelhfetueetheegfeehhfektddvleehtefhheevkeduleeuueevnecukfhppeduvdejrddtrddtrddupdelfedrieeirdefuddrkeelpdefjedrheelrddugedvrdduuddtnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeorghnughisegvthgviihirghnrdhorhhgqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhivdgtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth 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 --- drivers/i2c/busses/i2c-hix5hd2.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c index 64feaa9dca619..aecbe967e2640 100644 --- a/drivers/i2c/busses/i2c-hix5hd2.c +++ b/drivers/i2c/busses/i2c-hix5hd2.c @@ -416,12 +416,11 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev) if (irq < 0) return irq; - priv->clk = devm_clk_get(&pdev->dev, NULL); + priv->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(priv->clk)) { - dev_err(&pdev->dev, "cannot get clock\n"); + dev_err(&pdev->dev, "cannot enable clock\n"); return PTR_ERR(priv->clk); } - clk_prepare_enable(priv->clk); strscpy(priv->adap.name, "hix5hd2-i2c", sizeof(priv->adap.name)); priv->dev = &pdev->dev; @@ -442,7 +441,7 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev) IRQF_NO_SUSPEND, dev_name(&pdev->dev), priv); if (ret != 0) { dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", irq); - goto err_clk; + return ret; } pm_runtime_set_autosuspend_delay(priv->dev, MSEC_PER_SEC); @@ -459,8 +458,7 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev) err_runtime: pm_runtime_disable(priv->dev); pm_runtime_set_suspended(priv->dev); -err_clk: - clk_disable_unprepare(priv->clk); + return ret; } @@ -471,7 +469,6 @@ static void hix5hd2_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&priv->adap); pm_runtime_disable(priv->dev); pm_runtime_set_suspended(priv->dev); - clk_disable_unprepare(priv->clk); } #ifdef CONFIG_PM