From patchwork Wed Jun 1 23:15:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148633 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 49C1360751 for ; Wed, 1 Jun 2016 23:17:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C7C4271CB for ; Wed, 1 Jun 2016 23:17:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 310AC271F1; Wed, 1 Jun 2016 23:17:22 +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 A334A271CB for ; Wed, 1 Jun 2016 23:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbcFAXQg (ORCPT ); Wed, 1 Jun 2016 19:16:36 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33214 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbcFAXQK (ORCPT ); Wed, 1 Jun 2016 19:16:10 -0400 Received: by mail-pf0-f178.google.com with SMTP id b124so23339457pfb.0 for ; Wed, 01 Jun 2016 16:16:10 -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=L+0om6tSD4+9morlSqMeSVJtpb//u99POS4GnCN8lik=; b=WX51InC23Qyw9W9oMN19b1KeBP6w5EvN4UWxCJxK7MSi5kjDUYnWCg7+RBpYGmtiF0 PPT1XsM8NrzzhApQFDx2B15v3tR2f8zzd7OfaZIPua1M1AJQtMB/w2tc4wWphMAHMspA uYAcHYCoN5E/dXELQBA8Z9Sswkct1VIaCUa8U= 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=L+0om6tSD4+9morlSqMeSVJtpb//u99POS4GnCN8lik=; b=ZtzYC4jdYfNXjE0zdOfF6uXHYDRwd68VNYwm2EnLbQGTbQvsCT7nMtzWpDSsdQJXqC FgjTJxLobl+9bQB4s33Tv7l9jJ5GgsRO2qfoOCnd+MNcPYQhRBuC34TTTFROOaH7V0wI a4DkH8YvY45+rWIEQj8r/4omxo/OXF+f4+o9nulIt+fBDTgAYAP+9tXhcttllKmABaqN ig/P8rAyXAyaDTiIZRTb3SH4SWbxk1nM90b5Pycr60CiOQIVVL2Z4Cvf7v7hv0McQ8nQ X+U8PHE6kNUVEeafYZ28LmpW4XrFt6pRWESyjIGh1fmStlbGPmnj72Q/Xil680TgIlu7 vNFg== X-Gm-Message-State: ALyK8tKbYVoij4tJqNF4SfcTG9D0YjSd0X+Ce+TSObTW4PqgghongiPB63d0EJdokZ86qiJG X-Received: by 10.98.78.206 with SMTP id c197mr13547019pfb.129.1464822970099; Wed, 01 Jun 2016 16:16:10 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:16:09 -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, Sebastian Hesselbarth , Tony Prisk Subject: [PATCH 33/34] clk: vt8500: Migrate to clk_hw based registration APIs Date: Wed, 1 Jun 2016 16:15:32 -0700 Message-Id: <20160601231533.9354-34-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: Sebastian Hesselbarth Cc: Tony Prisk Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-vt8500.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c index b0f76a84f1e9..ed583bedef05 100644 --- a/drivers/clk/clk-vt8500.c +++ b/drivers/clk/clk-vt8500.c @@ -232,7 +232,7 @@ static const struct clk_ops vt8500_gated_divisor_clk_ops = { static __init void vtwm_device_clk_init(struct device_node *node) { u32 en_reg, div_reg; - struct clk *clk; + struct clk_hw *hw; struct clk_device *dev_clk; const char *clk_name = node->name; const char *parent_name; @@ -301,13 +301,14 @@ static __init void vtwm_device_clk_init(struct device_node *node) dev_clk->hw.init = &init; - clk = clk_register(NULL, &dev_clk->hw); - if (WARN_ON(IS_ERR(clk))) { + hw = &dev_clk->hw; + rc = clk_hw_register(NULL, hw); + if (WARN_ON(rc)) { kfree(dev_clk); return; } - rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); - clk_register_clkdev(clk, clk_name, NULL); + rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); + clk_hw_register_clkdev(hw, clk_name, NULL); } CLK_OF_DECLARE(vt8500_device, "via,vt8500-device-clock", vtwm_device_clk_init); @@ -692,7 +693,7 @@ static const struct clk_ops vtwm_pll_ops = { static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) { u32 reg; - struct clk *clk; + struct clk_hw *hw; struct clk_pll *pll_clk; const char *clk_name = node->name; const char *parent_name; @@ -725,13 +726,14 @@ static __init void vtwm_pll_clk_init(struct device_node *node, int pll_type) pll_clk->hw.init = &init; - clk = clk_register(NULL, &pll_clk->hw); - if (WARN_ON(IS_ERR(clk))) { + hw = &pll_clk->hw; + rc = clk_hw_register(NULL, &pll_clk->hw); + if (WARN_ON(rc)) { kfree(pll_clk); return; } - rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); - clk_register_clkdev(clk, clk_name, NULL); + rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); + clk_hw_register_clkdev(hw, clk_name, NULL); }