From patchwork Fri Feb 10 14:56:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13135874 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 EB674C05027 for ; Fri, 10 Feb 2023 14:57:53 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+Z3P0QwCUM94PJAO5+Hlfvu0PfJ+bxjgHP8Ek0CyBD8=; b=As7MqRA6cBbVay k3uwWa4RdiRFXcTdKAVafY0r5H9kcx7gWF/NeDCBgSMe064aahr952VA2liBUzrav48yHlvZlesRD f5UjVCaTCnkwG1dGPpKbGKEbJOuAH6rSqq+O4HewNcTAvaNURAr9qDQhMyC7pfQmTb1+SQFsQBKNX eqHBNq3LMAFeGUnW+cZ3vAip+LCsrxtHqcLdWF2JHw7YHMyLHTXzYxfsPgDagSMcvAUPlyzxlCpn/ P/nb+o1PKSCJhqw4Fq3LWutrofBHvCMsWDkY60ndzhvopl/1+Js61tBpkeSfRngNGLNQu16Ar9y9a yQmIogmWVxs+3/bXctjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQUpb-0068Fp-2W; Fri, 10 Feb 2023 14:56:55 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQUp9-0067zU-3N for linux-arm-kernel@lists.infradead.org; Fri, 10 Feb 2023 14:56:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676040987; x=1707576987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jUL6wp0NTeLmMM6UL4qWTlmx/HlyA4RONhL6c9GtXJ4=; b=BKCTUftfkkT5b8vrPsPpChgcQpH/tmHCD6G+kEAHZrTyfs9imR3JuUfY hksApdlud9iU7ic68BdRRjZ+S1HcL5O54GIHVFsjuPZ2g5/wAVQ2yU6Z7 QHbgA0lf4zl2e52dVe6fys0r1lv0XJdUWBWnmIsqHH7yxwC00SpJDdfug XlX1mAYZtewdqr90nnSw/10xJmrqkpBqdBl/wplo8nl1qvsE8khWcScvm VisSiomG+Rr136InxiRa7F1F4qylwsXIlxoAwxa4tL7jqfqounF/WCrjh rboVikgpJzzm5JxYCDq/Wge9eRv66w55QCHcHTAwE8JKqVk0J188nZAIr A==; X-IronPort-AV: E=McAfee;i="6500,9779,10617"; a="357836324" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="357836324" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2023 06:56:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10617"; a="668079984" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="668079984" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 10 Feb 2023 06:56:18 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id EAE95210; Fri, 10 Feb 2023 16:56:57 +0200 (EET) From: Andy Shevchenko To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/5] pinctrl: at91: Don't mix non-devm calls with devm ones Date: Fri, 10 Feb 2023 16:56:53 +0200 Message-Id: <20230210145656.71838-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210145656.71838-1-andriy.shevchenko@linux.intel.com> References: <20230210145656.71838-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230210_065627_202729_5C27D634 X-CRM114-Status: GOOD ( 16.02 ) 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: , Cc: Alexandre Belloni , Linus Walleij , Ludovic Desroches , Andy Shevchenko , Claudiu Beznea Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace devm_clk_get() by devm_clk_get_enabled() and drop unneeded code pieces. This will make sure we keep the ordering of the resource allocation correct. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-at91.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index bb93d8bcfd08..6d5ebdae0bf9 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1849,19 +1849,13 @@ static int at91_gpio_probe(struct platform_device *pdev) at91_chip->pioc_virq = irq; at91_chip->pioc_idx = alias_idx; - at91_chip->clock = devm_clk_get(&pdev->dev, NULL); + at91_chip->clock = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(at91_chip->clock)) { dev_err(&pdev->dev, "failed to get clock, ignoring.\n"); ret = PTR_ERR(at91_chip->clock); goto err; } - ret = clk_prepare_enable(at91_chip->clock); - if (ret) { - dev_err(&pdev->dev, "failed to prepare and enable clock, ignoring.\n"); - goto clk_enable_err; - } - at91_chip->chip = at91_gpio_template; at91_chip->id = alias_idx; @@ -1882,7 +1876,7 @@ static int at91_gpio_probe(struct platform_device *pdev) names = devm_kasprintf_strarray(dev, "pio", chip->ngpio); if (!names) { ret = -ENOMEM; - goto clk_enable_err; + goto err; } for (i = 0; i < chip->ngpio; i++) @@ -1915,8 +1909,6 @@ static int at91_gpio_probe(struct platform_device *pdev) return 0; gpiochip_add_err: -clk_enable_err: - clk_disable_unprepare(at91_chip->clock); err: dev_err(&pdev->dev, "Failure %i for GPIO %i\n", ret, alias_idx);