From patchwork Wed Jun 1 23:15:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148703 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 BBE9260751 for ; Wed, 1 Jun 2016 23:21:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEF4E26FA0 for ; Wed, 1 Jun 2016 23:21:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A423D271E0; Wed, 1 Jun 2016 23:21:35 +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 1C0EB26FA0 for ; Wed, 1 Jun 2016 23:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751058AbcFAXVB (ORCPT ); Wed, 1 Jun 2016 19:21:01 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:33184 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbcFAXP6 (ORCPT ); Wed, 1 Jun 2016 19:15:58 -0400 Received: by mail-pf0-f182.google.com with SMTP id b124so23337932pfb.0 for ; Wed, 01 Jun 2016 16:15:58 -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=7nPg68qzW3uSLEFAofT3ZjCkP/hArerhQO3lg5iebXU=; b=GYWfgP0dOAzp/giV6hs1ZpUDVSXw8J5lBmgvAA4SpHHDucE0VpCJEC8gZ7UST0LGYi q6MocOBE2vZcE6oMWWPs4WlKs0GtEyEBSicfJuSfp9XWisH0FantgvTJmlft3j7CBIjg wCxKoUMOeyIiBBmw22BR883giILyFYIbBYUs4= 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=7nPg68qzW3uSLEFAofT3ZjCkP/hArerhQO3lg5iebXU=; b=OWr7vtan6qan7ry0nAKgAbyWfoVb59O3Ybmde6UBSU12zm1m8G0efkAcSCiz30cH1u ArhvEyh40g6kjo9Ydydu4g6QbN6t8VK/p0fnXqKLxVRZ2MbBjSh1EZji3wUs7xaIdIct RARajs4QrXJsD41ttsg3SVsHdWO8OaT9x+D7RQB8tpU2w81uuSgsW2BCyTsL/wG4IxD3 liZdPOUq+fsP0wZDtK4Ium6BJcsgtatH6xD9jPsN+/BPczPEY3UyZBMvh/B2fSBBu8x2 cvR0Ti3Jb7QpwS9Aa4cz3WXb20DTvXrwKPhjczb9I9hjinU9amZt9FJiAciUChcTB0dc axIw== X-Gm-Message-State: ALyK8tLAprxQLMpFZ7Ke/NDD/Mp5NacaW/+ontilvfunofvuXLwd0rilIyd8c+qRUfP1pv/f X-Received: by 10.98.58.84 with SMTP id h81mr13656593pfa.93.1464822958002; Wed, 01 Jun 2016 16:15:58 -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.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:15:57 -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 Tang Subject: [PATCH 21/34] clk: nspire: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:20 -0700 Message-Id: <20160601231533.9354-22-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 Tang Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-nspire.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/clk/clk-nspire.c b/drivers/clk/clk-nspire.c index 64f196a90816..f861011d5d21 100644 --- a/drivers/clk/clk-nspire.c +++ b/drivers/clk/clk-nspire.c @@ -69,7 +69,7 @@ static void __init nspire_ahbdiv_setup(struct device_node *node, { u32 val; void __iomem *io; - struct clk *clk; + struct clk_hw *hw; const char *clk_name = node->name; const char *parent_name; struct nspire_clk_info info; @@ -85,10 +85,10 @@ static void __init nspire_ahbdiv_setup(struct device_node *node, of_property_read_string(node, "clock-output-names", &clk_name); parent_name = of_clk_get_parent_name(node, 0); - clk = clk_register_fixed_factor(NULL, clk_name, parent_name, 0, - 1, info.base_ahb_ratio); - if (!IS_ERR(clk)) - of_clk_add_provider(node, of_clk_src_simple_get, clk); + hw = clk_hw_register_fixed_factor(NULL, clk_name, parent_name, 0, + 1, info.base_ahb_ratio); + if (!IS_ERR(hw)) + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); } static void __init nspire_ahbdiv_setup_cx(struct device_node *node) @@ -111,7 +111,7 @@ static void __init nspire_clk_setup(struct device_node *node, { u32 val; void __iomem *io; - struct clk *clk; + struct clk_hw *hw; const char *clk_name = node->name; struct nspire_clk_info info; @@ -125,9 +125,10 @@ static void __init nspire_clk_setup(struct device_node *node, of_property_read_string(node, "clock-output-names", &clk_name); - clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, info.base_clock); - if (!IS_ERR(clk)) - of_clk_add_provider(node, of_clk_src_simple_get, clk); + hw = clk_hw_register_fixed_rate(NULL, clk_name, NULL, 0, + info.base_clock); + if (!IS_ERR(hw)) + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); else return;