From patchwork Wed Jun 1 23:15:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 69087 Delivered-To: patch@linaro.org Received: by 10.140.23.41 with SMTP id 38csp53205qgo; Wed, 1 Jun 2016 16:18:02 -0700 (PDT) X-Received: by 10.98.10.19 with SMTP id s19mr13290787pfi.71.1464823082722; Wed, 01 Jun 2016 16:18:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh16si815040pac.239.2016.06.01.16.18.02; Wed, 01 Jun 2016 16:18:02 -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=@linaro.org; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbcFAXR7 (ORCPT + 30 others); Wed, 1 Jun 2016 19:17:59 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34814 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbcFAXQH (ORCPT ); Wed, 1 Jun 2016 19:16:07 -0400 Received: by mail-pa0-f46.google.com with SMTP id bz2so516692pad.1 for ; Wed, 01 Jun 2016 16:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ho/R2IO67n9yI23l87Ki9hZM1ZwHhS9yb1FKe3Cm5a0=; b=BV0zaAw+LtQVSUKtrq0evgynBgS0ggDvHsJs865V5YuOtgjVhvzGkuSpbIVqxPH6/S cteAeCgQFDf1c1YGzYTSpASVcEYsfaxtGS0/fKba63rssZt9zMWx121LTRMT3P8yrWRG SP2/Hopo159e5K1+8zlNQ1BRQxFA2B/vQFeuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ho/R2IO67n9yI23l87Ki9hZM1ZwHhS9yb1FKe3Cm5a0=; b=YwmQesCE83ySMf/myKYqQWnBafLV/G2X6qJco5Mw14tPuJbvD61GukrU4bIO+eR8Wj 5y0fQrMwyf2NDHhl9EQt6jbJ+CvDqrsw1iuZ6C4uf/tIbya8nrdDb7GdrVxvWjkDxwFn ay/OsYN4ypWDodda4nTDMWfBUwOhYgBtIIY9LZEkL5NM52uAdQf33zJBYuIQIvDZsT+P g+y7SAyxaOUw22S7Hsqtref0O2Q9lfOr+1nB31BQ+gfp+UI+49uNZkZKXp4X6Goov1Zj StMyY2RLU4aPodZ08UnPOS4gq+o9oTJ8Klxq8ahwk634U5EAP5tGJGcwCc3BYOiVJlYO bg6A== X-Gm-Message-State: ALyK8tImENvZiPzGaLrY2IsM75UL1LxStWJdH4+TMzBG4O/z+o8QDF1TB2rkupiyo3wNVMst X-Received: by 10.66.65.109 with SMTP id w13mr1107539pas.142.1464822967071; Wed, 01 Jun 2016 16:16:07 -0700 (PDT) Received: from localhost.localdomain (pat_11.qualcomm.com. [192.35.156.11]) by smtp.gmail.com with ESMTPSA id r64sm20967395pfi.54.2016.06.01.16.16.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:16:06 -0700 (PDT) From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Daniel Thompson Subject: [PATCH 30/34] clk: stm32f3: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:29 -0700 Message-Id: <20160601231533.9354-31-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0-rc1 In-Reply-To: <20160601231533.9354-1-stephen.boyd@linaro.org> References: <20160601231533.9354-1-stephen.boyd@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have clk_hw based provider APIs to register clks, we can get rid of struct clk pointers while registering clks in these drivers, allowing us to move closer to a clear split of consumer and provider clk APIs. Cc: Daniel Thompson Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-stm32f4.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/clk/clk-stm32f4.c b/drivers/clk/clk-stm32f4.c index fd89e771107e..b6ca33f0c935 100644 --- a/drivers/clk/clk-stm32f4.c +++ b/drivers/clk/clk-stm32f4.c @@ -136,7 +136,7 @@ static const u64 stm32f42xx_gate_map[] = { 0x000000f17ef417ffull, 0x0000000000000001ull, 0x04777f33f6fec9ffull }; -static struct clk *clks[MAX_CLKS]; +static struct clk_hw *clks[MAX_CLKS]; static DEFINE_SPINLOCK(stm32f4_clk_lock); static void __iomem *base; @@ -281,7 +281,7 @@ static int stm32f4_rcc_lookup_clk_idx(u8 primary, u8 secondary) (BIT_ULL_WORD(secondary) >= 2 ? hweight64(table[2]) : 0); } -static struct clk * +static struct clk_hw * stm32f4_rcc_lookup_clk(struct of_phandle_args *clkspec, void *data) { int i = stm32f4_rcc_lookup_clk_idx(clkspec->args[0], clkspec->args[1]); @@ -346,9 +346,9 @@ static void __init stm32f4_rcc_init(struct device_node *np) clk_register_apb_mul(NULL, "apb2_mul", "apb2_div", CLK_SET_RATE_PARENT, 15); - clks[SYSTICK] = clk_register_fixed_factor(NULL, "systick", "ahb_div", + clks[SYSTICK] = clk_hw_register_fixed_factor(NULL, "systick", "ahb_div", 0, 1, 8); - clks[FCLK] = clk_register_fixed_factor(NULL, "fclk", "ahb_div", + clks[FCLK] = clk_hw_register_fixed_factor(NULL, "fclk", "ahb_div", 0, 1, 1); for (n = 0; n < ARRAY_SIZE(stm32f4_gates); n++) { @@ -360,7 +360,7 @@ static void __init stm32f4_rcc_init(struct device_node *np) if (idx < 0) goto fail; - clks[idx] = clk_register_gate( + clks[idx] = clk_hw_register_gate( NULL, gd->name, gd->parent_name, gd->flags, base + gd->offset, gd->bit_idx, 0, &stm32f4_clk_lock); @@ -371,7 +371,7 @@ static void __init stm32f4_rcc_init(struct device_node *np) } } - of_clk_add_provider(np, stm32f4_rcc_lookup_clk, NULL); + of_clk_add_hw_provider(np, stm32f4_rcc_lookup_clk, NULL); return; fail: iounmap(base);