From patchwork Mon Jul 31 04:27:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13333621 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 A4ADDC001DE for ; Mon, 31 Jul 2023 04:28:56 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+ymoCS6GOBcxmo2p9oFkhAZHaYVmUV8J2RhWhOpPL6g=; b=D2hOeDOSr6d6lp bG4gsUAgDVG4Ung1wn94ROiNOaT/IzgRX71zG63Iu09qYceMVQNigO/XLqmtmokqCKb0RXNQZealH WiafAi7mtk3KPHwtkRpTGXf3P62uW1r1rJpWyZYJmpna/te5+uxaxZn3dsqDHGH0jrTUUd1Qg6KLV qCbBMJlvtfn45jPkWE/UK0XgoMKkffD7SrOE+qFDPNOaTu3TKfSZZe5lKflUc5NEaYiLI6yi9SjlX 76JCvsQNtQ+r7VLEQErvFwYx16A41UG4N2K2AOxA8THrNIoV0jlix4AI6Uj/MFi5gubw4JPZ3kLyI GCnI/tCNUODccPvZyfLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQKWG-00DpvL-1T; Mon, 31 Jul 2023 04:28:32 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQKWB-00DpuP-26 for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 04:28:30 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b9cdef8619so24777125ad.0 for ; Sun, 30 Jul 2023 21:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690777704; x=1691382504; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5A36sJfoTWTZxxRtlkUpT4+tRtDcKRqPwRCEoULd4eU=; b=b5DQ6Rlyi7Lq9BXtLOOwalkREoNbb87b7unENttOCjxE8BVeLJiZVLColztFw+ksZi T5RO9eNtw8w4tbxo8yjiH8JdzdVbiLrXtczhvTfIZrpykQ7oQia1ZRmOGhd2hBXjrtZT V8fl0WKyk3tkCepVejzvfjyVLsuOV988AmZX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690777704; x=1691382504; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5A36sJfoTWTZxxRtlkUpT4+tRtDcKRqPwRCEoULd4eU=; b=bH00aBK2cWE3QHQ43aLYOPDlW42LhJYaEZVYvSTrhF7GcaT5swJ/1nHtUxiZX6Ukfr Bqp2Y36Cy8afj07W6il8sZ0ursrsY2iEjJ5AHQhXJFUOZBwVQqDCiNgfjv62clLh8J6I ThK3lPFVchDhsTL/clW69RpEFn5G9N0SxuO/hNQvBw7bFpMfIhnNujphAd4Mo+8X8x5f S16lckO8Zp9f2G9QaAXBlFUsxzrESIfGL1kteJup8NzJV4xgvCV6McXxtJ3Dp5y5Ky3X 9CUIuJ2HJ9woHx3lt+oawpbHEGp+zqpk0ofVNyvr4iC2RN+e+QiqDT4Vva4rO30SR70r EJNw== X-Gm-Message-State: ABy/qLZFiuIYLxT5+EVK4S0Bz3xq+rOxc9MwrqePiADXKvGWeA5Jrac9 lCMrisLl9eCVSnbeLFnYrquQiw== X-Google-Smtp-Source: APBJJlGW73mZDqZnkyjN83Bmi8SBbMUxpBxQv5ILrRrZFjgWoHlYdewLdEqjUMKHtrkbxW8SlUceaA== X-Received: by 2002:a17:902:d4c3:b0:1b8:b3f0:3d57 with SMTP id o3-20020a170902d4c300b001b8b3f03d57mr9821918plg.31.1690777704531; Sun, 30 Jul 2023 21:28:24 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fd7a:6af2:fca:ff71]) by smtp.gmail.com with ESMTPSA id t15-20020a170902b20f00b001b9df8f14d7sm7349096plr.267.2023.07.30.21.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 21:28:24 -0700 (PDT) From: Chen-Yu Tsai To: Neil Armstrong , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Stephen Boyd Cc: Chen-Yu Tsai , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: meson: meson8b: Simplify notifier clock lookup Date: Mon, 31 Jul 2023 12:27:53 +0800 Message-ID: <20230731042807.1322972-1-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230730_212827_742180_5FC0E470 X-CRM114-Status: GOOD ( 14.40 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver registers a clock notifier by first getting the name of one of its clocks it just registered, then uses the name to look up the clock. The lookup is not needed, since each clock provider already has a clock attached to it. Use that instead to get rid of a __clk_lookup() call. Signed-off-by: Chen-Yu Tsai --- Found this could be simplified while looking through some clk core code. drivers/clk/meson/meson8b.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 827e78fb16a8..c4336ac012bf 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -3793,7 +3793,6 @@ static void __init meson8b_clkc_init_common(struct device_node *np, { struct meson8b_clk_reset *rstc; struct device_node *parent_np; - const char *notifier_clk_name; struct clk *notifier_clk; struct regmap *map; int i, ret; @@ -3847,9 +3846,7 @@ static void __init meson8b_clkc_init_common(struct device_node *np, * tricky programming sequence will be handled by the forthcoming * coordinated clock rates mechanism once that feature is released. */ - notifier_clk_name = clk_hw_get_name(&meson8b_cpu_scale_out_sel.hw); - notifier_clk = __clk_lookup(notifier_clk_name); - ret = clk_notifier_register(notifier_clk, &meson8b_cpu_nb_data.nb); + ret = clk_notifier_register(meson8b_cpu_scale_out_sel.hw.clk, &meson8b_cpu_nb_data.nb); if (ret) { pr_err("%s: failed to register the CPU clock notifier\n", __func__);