From patchwork Thu Jul 20 14:08:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuanjun Gong X-Patchwork-Id: 704727 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 8887EEB64DA for ; Thu, 20 Jul 2023 14:08:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbjGTOIa (ORCPT ); Thu, 20 Jul 2023 10:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbjGTOIa (ORCPT ); Thu, 20 Jul 2023 10:08:30 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76E07211F for ; Thu, 20 Jul 2023 07:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=Tc8ki60neDbZDKDXdc pEuHUnrcBvO3cBQjJ/0Y/pqsU=; b=mo6vnc3AiNGmmNKOhkfNbt9zFy8fiow2oy kXoEDMopeZZkNWVjgLM8lQUGJFvwSzfAH4qsiO2va9Oi/vVrLjhOR7TxiILk2QAT xUbxAjeEfRtvRXciumzyFDVek73RPnKeHHsCNvL1nMY3NCtxn7Hi64p0GBhf6Y/d vh2Sdgf0I= Received: from localhost.localdomain (unknown [202.112.113.212]) by zwqz-smtp-mta-g3-4 (Coremail) with SMTP id _____wB37nrFP7lknINKAw--.14425S4; Thu, 20 Jul 2023 22:08:11 +0800 (CST) From: Yuanjun Gong To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , linux-gpio@vger.kernel.org Cc: Yuanjun Gong Subject: [PATCH 1/1] pinctrl: mvebu: use devm_clk_get_enabled() in dove_pinctrl_probe() Date: Thu, 20 Jul 2023 22:08:03 +0800 Message-Id: <20230720140803.33174-1-ruc_gongyuanjun@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: _____wB37nrFP7lknINKAw--.14425S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw13Kr1ftr4xCFy8Zr4xWFg_yoWkuwb_ua yxAryftry3Wr18Xryjyw4rZFWIkF4kur10gr1vvFWakFy7Xw1DK397ursxCws7Ww47Jr98 GFyUZFWfC34fAjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRRBMKPUUUUU== X-Originating-IP: [202.112.113.212] X-CM-SenderInfo: 5uxfsw5rqj53pdqm30i6rwjhhfrp/1tbiJw6y5V5vE1q+SwABsy Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org in dove_pinctrl_probe(), the return value of function clk_prepare_enable() should be checked, since it may fail. using devm_clk_get_enabled() instead of devm_clk_get() and clk_prepare_enable() can avoid this problem. Signed-off-by: Yuanjun Gong --- drivers/pinctrl/mvebu/pinctrl-dove.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c index 545486d98532..bcd72fef4c85 100644 --- a/drivers/pinctrl/mvebu/pinctrl-dove.c +++ b/drivers/pinctrl/mvebu/pinctrl-dove.c @@ -777,12 +777,11 @@ static int dove_pinctrl_probe(struct platform_device *pdev) * General MPP Configuration Register is part of pdma registers. * grab clk to make sure it is ticking. */ - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "Unable to get pdma clock"); return PTR_ERR(clk); } - clk_prepare_enable(clk); mpp_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, mpp_res);