From patchwork Tue Aug 16 22:37:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9284965 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 3573D607FD for ; Tue, 16 Aug 2016 22:45:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24A2A28763 for ; Tue, 16 Aug 2016 22:45:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1961528799; Tue, 16 Aug 2016 22:45:03 +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=ham 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 6269928763 for ; Tue, 16 Aug 2016 22:45:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753013AbcHPWpC (ORCPT ); Tue, 16 Aug 2016 18:45:02 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34143 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752422AbcHPWpB (ORCPT ); Tue, 16 Aug 2016 18:45:01 -0400 Received: by mail-pa0-f41.google.com with SMTP id fi15so30327517pac.1 for ; Tue, 16 Aug 2016 15:45:01 -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; bh=G/pMldiYN3dq1dVPMc8An612ylRTyCzevHKzT+oUuf0=; b=gjO5MFha8bX9ErAKfF5vnYovkW890WFqs6VgWAEOePp/SBQytUOCbe0afIIIO/UvBC 9XNRKQM3JrPYnw9uo85p4dUAYNClZmjzWLpXhaZEi+S9pX5wiROqGFuKTXKC5Y3XavG9 P+dFcMRtU2rzUAH14PfsCDRYMCwiBA3FQ85BI= 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; bh=G/pMldiYN3dq1dVPMc8An612ylRTyCzevHKzT+oUuf0=; b=O8TYgjz1KwfbZOdSwHSFrM6Yn17y1boPG142+lBVY1b1JJLprjK02OH432LY3bcDCv DEcyChmckA1XoacNwX9TKH10dtQf1NckJ/kAbbOjFh32oZuDcIbaQYWi+DrV3QuRLnl6 QrGrxLd7zNw6mnqUBrrEWATcFJGN3ciZlWyZS2QA5r5fJZPMqqtk0ZMlfpdVipAkH9Ez 6QYxpSEVVJUOLmsBODhPcYFG7/mh+5tX/hupIzUgYuC3FTc98KkO7XsUqKPJb1VVZrbZ 8SFpoLjrDHLXsGM8LSfC8Bh+488NUYY6hhdtVw+mCoF0r8Il9OXO4JlWmLM8CLD+i5R3 aUmw== X-Gm-Message-State: AEkoousuZNYYZ4DmP78lA93w2kL76Rb8MeX9YrrUKuDhFsLuJJFRP7XbKIfFtoG1XcOQIr2y X-Received: by 10.66.80.2 with SMTP id n2mr68094479pax.134.1471387080373; Tue, 16 Aug 2016 15:38:00 -0700 (PDT) Received: from localhost.localdomain (ip68-101-172-78.sd.sd.cox.net. [68.101.172.78]) by smtp.gmail.com with ESMTPSA id k78sm41724521pfa.78.2016.08.16.15.37.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 15:37:59 -0700 (PDT) From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Yoshinori Sato , uclinux-h8-devel@lists.sourceforge.jp Subject: [PATCH] clk: h8300: Migrate to clk_hw based registration APIs Date: Tue, 16 Aug 2016 15:37:57 -0700 Message-Id: <20160816223757.726-1-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0.rc2.8.ga28705d 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: Yoshinori Sato Cc: Signed-off-by: Stephen Boyd --- drivers/clk/h8300/clk-div.c | 10 +++++----- drivers/clk/h8300/clk-h8s2678.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/clk/h8300/clk-div.c b/drivers/clk/h8300/clk-div.c index 4bf44a25d950..715b882205a8 100644 --- a/drivers/clk/h8300/clk-div.c +++ b/drivers/clk/h8300/clk-div.c @@ -14,7 +14,7 @@ static DEFINE_SPINLOCK(clklock); static void __init h8300_div_clk_setup(struct device_node *node) { unsigned int num_parents; - struct clk *clk; + struct clk_hw *hw; const char *clk_name = node->name; const char *parent_name; void __iomem *divcr = NULL; @@ -38,15 +38,15 @@ static void __init h8300_div_clk_setup(struct device_node *node) parent_name = of_clk_get_parent_name(node, 0); of_property_read_u32(node, "renesas,width", &width); - clk = clk_register_divider(NULL, clk_name, parent_name, + hw = clk_hw_register_divider(NULL, clk_name, parent_name, CLK_SET_RATE_GATE, divcr, offset, width, CLK_DIVIDER_POWER_OF_TWO, &clklock); - if (!IS_ERR(clk)) { - of_clk_add_provider(node, of_clk_src_simple_get, clk); + if (!IS_ERR(hw)) { + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); return; } pr_err("%s: failed to register %s div clock (%ld)\n", - __func__, clk_name, PTR_ERR(clk)); + __func__, clk_name, PTR_ERR(hw)); error: if (divcr) iounmap(divcr); diff --git a/drivers/clk/h8300/clk-h8s2678.c b/drivers/clk/h8300/clk-h8s2678.c index c9c2fd575ef7..a26312460621 100644 --- a/drivers/clk/h8300/clk-h8s2678.c +++ b/drivers/clk/h8300/clk-h8s2678.c @@ -84,11 +84,11 @@ static const struct clk_ops pll_ops = { static void __init h8s2678_pll_clk_setup(struct device_node *node) { unsigned int num_parents; - struct clk *clk; const char *clk_name = node->name; const char *parent_name; struct pll_clock *pll_clock; struct clk_init_data init; + int ret; num_parents = of_clk_get_parent_count(node); if (!num_parents) { @@ -121,14 +121,14 @@ static void __init h8s2678_pll_clk_setup(struct device_node *node) init.num_parents = 1; pll_clock->hw.init = &init; - clk = clk_register(NULL, &pll_clock->hw); - if (IS_ERR(clk)) { - pr_err("%s: failed to register %s div clock (%ld)\n", - __func__, clk_name, PTR_ERR(clk)); + ret = clk_hw_register(NULL, &pll_clock->hw); + if (ret) { + pr_err("%s: failed to register %s div clock (%d)\n", + __func__, clk_name, ret); goto unmap_pllcr; } - of_clk_add_provider(node, of_clk_src_simple_get, clk); + of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clock->hw); return; unmap_pllcr: