Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2116864ybg; Sun, 27 Oct 2019 11:24:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjScXjJOyIkruGnjySeDl1eMGKekk6yAQTAwXaprf+bdOxUMfngF0IhsK7X1Y2njLyuhA5 X-Received: by 2002:aa7:d554:: with SMTP id u20mr7481160edr.6.1572200677706; Sun, 27 Oct 2019 11:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572200677; cv=none; d=google.com; s=arc-20160816; b=VEGnJqjQKL+E66gEICpc3ArtVg0FJBqHVbNNyw3uOvyWL9XRtYy2uP/ZaOps5swx0m ZmU3pLQ4f/but5sN2RN01p/pUms4ivB9IXALSiZGsDLWFXt97omh+wCWSFCIsQVDUOrM O0LjPdX8bM792TsEBk7k8gBd9md4eut+61cav0Uks92TtnW+xcrSSAaBzAoj3PGYzRiK /lUs8PQCpUEWKslHT1JDVnZc3z3QfbAffrzXmJrF/cIW4Iq13ZiQ5f4YNhH8/voGugeb fM8pHYl2TMofge9F1LY4aQEEQ/8cIZGshZm0slTr/WamYGMwGYdi4LD5l2XHumW9okOm aMeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CPQNzivuVZNWDtPwgDvWYp9o/YTaW3TY1ny0gNcTyh8=; b=DyIg9ndIbQfqDCo40o6M128OHR6UlgpwHP6sR2GNqIANeGhjugxpQnw1eMzGG8VRxp Q/O4jJPz5rq+IjkHg+2NxpguHXlt6yOZNP9BtDvLbXF5k0R9bSf4xU1J32LIa+M1U0FN 6T7hIWA6uES6eS7GWSXXrTtHJHYHN8sePFOsLMrVxBXNVwHSBaMiAWMz37XWhX9Zu6BN wRpRuk1vfyeNgohIRXNoTjeWwbQrAPIjWzBA5N5KWyY04SWnfN4FEx+O9R/gVAneyjcq wmF7ZGxz616uGKjkIdYC7I9gyFugpKNBKA2T1hzAkgbpk8npm0zeQER6oGRk+kttolu3 rwOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=eh1WeQJU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si6592610edk.331.2019.10.27.11.24.14; Sun, 27 Oct 2019 11:24:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=eh1WeQJU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727690AbfJ0QSS (ORCPT + 99 others); Sun, 27 Oct 2019 12:18:18 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36339 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727280AbfJ0QSR (ORCPT ); Sun, 27 Oct 2019 12:18:17 -0400 Received: by mail-wm1-f65.google.com with SMTP id c22so6694626wmd.1; Sun, 27 Oct 2019 09:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CPQNzivuVZNWDtPwgDvWYp9o/YTaW3TY1ny0gNcTyh8=; b=eh1WeQJUqLqmNq7P5g77WEfxAuW9neRhh+Met5oYqfM/347j8sLtzsTSeh334FZcke mdSDPnwhvk9xiHA8r404dwDpMZQfA+3v7HOFnzcNVF01PiBTcW7xaRUBKAAVPPffJWUp n8TH/PSO82uFK1dIBcVzajImWj23r6JJmJOMKLXqwoXG7ycIbJj2vbn/2K5OInyOFCMc e4ePBKVK8O5xCHy8FQoUhdTP0Hz9TL4fFH0sLCzwsorlgV9cD3GbHGCnv9Qw9Bv/Mvd8 TAjg0bZuKIGThrBMSx2Wj03CnIsphlJsMouXd2kqscALnb1TFq/oDfoZHP8HdCOJCYRX 8Tcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CPQNzivuVZNWDtPwgDvWYp9o/YTaW3TY1ny0gNcTyh8=; b=eogpjbzX8qnPiypKVhb4O6j/HLSiFkLLA1/LM3wLLrUxueQhvCFofzko6z7+af5+LU FP/PFte15i6NyjKgTrX00/uIvXK5pkJl4tGBY495illKZswdrOV9mJ+O/6jPZS5IXwbc zVnUZq1RzZwk8J78qIqXb6QCyMCaXKszVeyohjOJmzG4AXVox/5mAYrwkUHBLR0D/n87 p2xspfoLI+34EVsRFKd9pYmh53n39w0aRGMQVyS7t3kXMaDLw2uqRe3WWZMgfzeIX7NJ 8Qmg3bcWhlEjk5PLPHZEK2zCTFYMl1Wzkim9Ykb2kZFp+MGNLI0k0SdMJ+jbeRRrqfCV O5uw== X-Gm-Message-State: APjAAAUo7QKr3qcwHMfHEc9DEhmBidMAw1cxmYSvvEmoZuQXerfTn9ve Tiz4G+cH+25N85gOZA2gcas= X-Received: by 2002:a1c:b4c2:: with SMTP id d185mr11147241wmf.159.1572193094673; Sun, 27 Oct 2019 09:18:14 -0700 (PDT) Received: from localhost.localdomain (p200300F133D01300428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:33d0:1300:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id j14sm9585014wrj.35.2019.10.27.09.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2019 09:18:14 -0700 (PDT) From: Martin Blumenstingl To: narmstrong@baylibre.com, jbrunet@baylibre.com, linux-amlogic@lists.infradead.org, khilman@baylibre.com Cc: robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v2 2/5] clk: meson: meson8b: use clk_hw_set_parent in the CPU clock notifier Date: Sun, 27 Oct 2019 17:18:02 +0100 Message-Id: <20191027161805.1176321-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027161805.1176321-1-martin.blumenstingl@googlemail.com> References: <20191027161805.1176321-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch from clk_set_parent() to clk_hw_set_parent() now that we have a way to configure a mux clock based on clk_hw pointers. This simplifies the meson8b_cpu_clk_notifier_cb logic. No functional changes. Signed-off-by: Martin Blumenstingl --- drivers/clk/meson/meson8b.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 67e6691e080c..d376f80e806d 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -3585,7 +3585,7 @@ static const struct reset_control_ops meson8b_clk_reset_ops = { struct meson8b_nb_data { struct notifier_block nb; - struct clk_hw_onecell_data *onecell_data; + struct clk_hw *cpu_clk; }; static int meson8b_cpu_clk_notifier_cb(struct notifier_block *nb, @@ -3593,30 +3593,25 @@ static int meson8b_cpu_clk_notifier_cb(struct notifier_block *nb, { struct meson8b_nb_data *nb_data = container_of(nb, struct meson8b_nb_data, nb); - struct clk_hw **hws = nb_data->onecell_data->hws; - struct clk_hw *cpu_clk_hw, *parent_clk_hw; - struct clk *cpu_clk, *parent_clk; + struct clk_hw *parent_clk; int ret; switch (event) { case PRE_RATE_CHANGE: - parent_clk_hw = hws[CLKID_XTAL]; + /* xtal */ + parent_clk = clk_hw_get_parent_by_index(nb_data->cpu_clk, 0); break; case POST_RATE_CHANGE: - parent_clk_hw = hws[CLKID_CPU_SCALE_OUT_SEL]; + /* cpu_scale_out_sel */ + parent_clk = clk_hw_get_parent_by_index(nb_data->cpu_clk, 1); break; default: return NOTIFY_DONE; } - cpu_clk_hw = hws[CLKID_CPUCLK]; - cpu_clk = __clk_lookup(clk_hw_get_name(cpu_clk_hw)); - - parent_clk = __clk_lookup(clk_hw_get_name(parent_clk_hw)); - - ret = clk_set_parent(cpu_clk, parent_clk); + ret = clk_hw_set_parent(nb_data->cpu_clk, parent_clk); if (ret) return notifier_from_errno(ret); @@ -3695,7 +3690,7 @@ static void __init meson8b_clkc_init_common(struct device_node *np, return; } - meson8b_cpu_nb_data.onecell_data = clk_hw_onecell_data; + meson8b_cpu_nb_data.cpu_clk = clk_hw_onecell_data->hws[CLKID_CPUCLK]; /* * FIXME we shouldn't program the muxes in notifier handlers. The -- 2.23.0