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: 9148643 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1871C60751 for ; Wed, 1 Jun 2016 23:18:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AED6271CB for ; Wed, 1 Jun 2016 23:18:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3D35271F1; Wed, 1 Jun 2016 23:18:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81389271CB for ; Wed, 1 Jun 2016 23:18:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbcFAXR6 (ORCPT ); Wed, 1 Jun 2016 19:17:58 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34814 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbcFAXQH (ORCPT ); Wed, 1 Jun 2016 19:16:07 -0400 Received: by mail-pa0-f45.google.com with SMTP id bz2so516690pad.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=SmUMbUvnfxmhqGXKKVdA49ETsEtF+/Ms00B8QugTB5LkzmdjaypGCMbhmUWh8wjZkj 5HaBwqlC4JjtNmyNOSBlh+IqRYKXMcp2fmL9WqQbC+KRF8IVUOtCQy14qz+PDdZvS047 yodDYKryFUFXJPo44IszewP4Aw5PmuPyxEaYAdvXIn823WFzAMJNSgl+wOq8+j3lA4yp WFPCv46B6WyNyfJgpTKlf3qywVsQbFSeMMoRKA+JPe0g0sHS21GD5oLjqFZ3bQHHGGAX ZFB6O6qB3dnxkI9ofSElRo+B4DsBBiV7mlhkdVHvBtjrPSiXSAiKJJaUrQBpuBKLvzCm 8SpA== X-Gm-Message-State: ALyK8tLFtZ+JIuqAsGtbhp0v1g6/naMC4EAMPfiOTQ87kjKJnbxUuS31KP7RZarpY+w9nw4E 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);