Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp847423rwb; Thu, 6 Oct 2022 05:26:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IO3hcCwvUKwaMhyMv6uWR0/Iol5QYaY52ythj4DlpryPWHHhaMrqJkpYC5ICq0VoFPTg8 X-Received: by 2002:a05:6a00:234b:b0:561:f0c3:cdee with SMTP id j11-20020a056a00234b00b00561f0c3cdeemr4798963pfj.32.1665059174046; Thu, 06 Oct 2022 05:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665059174; cv=none; d=google.com; s=arc-20160816; b=juU3BqdXzkBudyfJ3i8XbfmhX7UNOpdTrLJwxbPavYpferzoV6dK9iKbMfIQbjz+oA RuKjEP7GA0Ov1QFmntZILMvqthbKaSJCGxNvCPvTNqV7nTi6Z7plGQpCkiPHu1IEU52v bLaFQVndbWUzx4IklK2MZ7tn8fkgZLE51zOCvCgX9MxmrG6wcufDezNxWqkVaDqBorFp F8dkggu8LwkNOswiFSZOSB86wMf5RPA7Zd+k+5pJ7ugH4niP7niCeUSt8I2LRvBv2hSN B8UfzSFVKYxMV3CHERWUwqXzgMwaaQ+ziPslI/042xDlwfz8ZHmosIWIiBNVUzWjirfS TE+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wFK1uKTUOAkzTvMlphed7epH9gF2qVFBzp5PoxItuo0=; b=W5lQDkmLT+oL9urpyvNUvphZiZ9CrHTvOjyZwNeaJ72ko3TCEc7Xh8cYaceWntDz64 GgX/IH9OTjy2luTEOvEZK+rc9xUn4U/W0vIVa8T4eW+iUi0xG4LVcAzCpX+q3WE5Gkhk zqxznNFrWBDRT69sIQ+EFn5ydFyDz71VVTc6TKnqcQ3mYgXzdCyzCcFIKPvlOLFlGQVQ RisS0ngrfK2/tdcg+dHSddzJRKy1rTFgPgPFbdhheueUtCJGKq8bpxKoZ8dO752JULgG HcQYgHQwLqm+D904XN3kx7J3eBVIvkd5ihnob/T2xG2EzbbNQUQSJr+qaFjAEJ7ZvAGr GVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S2XPIqIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds16-20020a17090b08d000b0020af8232048si3227368pjb.139.2022.10.06.05.26.02; Thu, 06 Oct 2022 05:26:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=S2XPIqIl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbiJFLKZ (ORCPT + 99 others); Thu, 6 Oct 2022 07:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231454AbiJFLJz (ORCPT ); Thu, 6 Oct 2022 07:09:55 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3515586 for ; Thu, 6 Oct 2022 04:09:40 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 5A61766022F9; Thu, 6 Oct 2022 12:09:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1665054579; bh=HaMjBUnn0XP2R6tqIgzWDxijRENloQ+oZZWaIxT+XMY=; h=From:To:Cc:Subject:Date:From; b=S2XPIqIl4XEBq6BBtHS99Mn2AoFFc3pEx/KdumCdajL2VmOl3rb9C3ZR2yOlk1ohK sde1jTKKH/VMrsPwr6Xo87H+UMccKSW9IH9c82dF3JdDick1uv7FV7BuVesSsiYIcZ yceziv4oW/eeB9RwRPCPhRu8BA8oXWQNJqU4wgz+pqlPW2SZ+hbajlc57DrTa4aE9H S6Qxlc+AKDF6LMQ2OO8FkrLJiV3u0ubg0SS72pzltyAXEN047IbmT1QHSdHyN2SKdw kP+SgBt3oKCPoW3Df//T/Yp3UNBNWs0EmSP1TiTgTWKaegS/7vFXQKFO82ayI6+g34 1YZ8DMvB7UpGw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno Subject: [PATCH] soc: mediatek: mtk-devapc: Switch to devm_clk_get_enabled() Date: Thu, 6 Oct 2022 13:09:35 +0200 Message-Id: <20221006110935.59695-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This driver does exactly devm_clk_get() and clk_prepare_enable() right after, which is exactly what devm_clk_get_enabled() does: clean that up by switching to the latter. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-devapc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/soc/mediatek/mtk-devapc.c b/drivers/soc/mediatek/mtk-devapc.c index fc13334db1b1..bad139cb117e 100644 --- a/drivers/soc/mediatek/mtk-devapc.c +++ b/drivers/soc/mediatek/mtk-devapc.c @@ -276,19 +276,14 @@ static int mtk_devapc_probe(struct platform_device *pdev) if (!devapc_irq) return -EINVAL; - ctx->infra_clk = devm_clk_get(&pdev->dev, "devapc-infra-clock"); + ctx->infra_clk = devm_clk_get_enabled(&pdev->dev, "devapc-infra-clock"); if (IS_ERR(ctx->infra_clk)) return -EINVAL; - if (clk_prepare_enable(ctx->infra_clk)) - return -EINVAL; - ret = devm_request_irq(&pdev->dev, devapc_irq, devapc_violation_irq, IRQF_TRIGGER_NONE, "devapc", ctx); - if (ret) { - clk_disable_unprepare(ctx->infra_clk); + if (ret) return ret; - } platform_set_drvdata(pdev, ctx); @@ -303,8 +298,6 @@ static int mtk_devapc_remove(struct platform_device *pdev) stop_devapc(ctx); - clk_disable_unprepare(ctx->infra_clk); - return 0; } -- 2.37.2