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: 69084 Delivered-To: patch@linaro.org Received: by 10.140.23.41 with SMTP id 38csp52911qgo; Wed, 1 Jun 2016 16:17:12 -0700 (PDT) X-Received: by 10.66.171.231 with SMTP id ax7mr1128583pac.104.1464823032747; Wed, 01 Jun 2016 16:17:12 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf10si14639966pab.204.2016.06.01.16.17.12; Wed, 01 Jun 2016 16:17:12 -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 S1752529AbcFAXQh (ORCPT + 30 others); Wed, 1 Jun 2016 19:16:37 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:35813 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752322AbcFAXQK (ORCPT ); Wed, 1 Jun 2016 19:16:10 -0400 Received: by mail-pf0-f180.google.com with SMTP id g64so23334797pfb.2 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=kC1JIE+1K911dznSlaK4ByYixtgdprmPmvmCuNE/WYN0ehXNjXTVCgcSYGUn5jRexp VKhHAsKG+ouULZYbpO+czpk/QCi3bsE/M7GgUlUC0XMfQP308z1c3A9YZ0D2Pcnd96a6 cIKK/M9mtIy6T4BUgDroBU3vFQybuUNxZJnUocB9DvmfGtawbI4iyQ0OYUV/G5nHknw9 OwsHtoMI+KC5NXv+U7LNrKrv29jczew605JJmYU0xSxNnuwj6td/foeAQ95RFEX906Xw bW/znc1i90yESmL6FBzvkwrfJtyIOZza8hZ21PGwOdw0FpRfxQxBB5aK6ZQSg7ARXo6D xwng== X-Gm-Message-State: ALyK8tLzectDiYNXUqhla1lT0ttEx5UvIKUfI2SdIWeE0LJjORcDV3WwK3U7sHzVMneenU1E 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-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: 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(-) -- 2.7.4 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); }