From patchwork Wed Jun 1 23:15:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148691 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 1033960751 for ; Wed, 1 Jun 2016 23:20:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 035DB26FA0 for ; Wed, 1 Jun 2016 23:20:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC725271E0; Wed, 1 Jun 2016 23:20:57 +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 0440326FA0 for ; Wed, 1 Jun 2016 23:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751994AbcFAXUn (ORCPT ); Wed, 1 Jun 2016 19:20:43 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:32826 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751897AbcFAXP7 (ORCPT ); Wed, 1 Jun 2016 19:15:59 -0400 Received: by mail-pa0-f45.google.com with SMTP id um11so516398pab.0 for ; Wed, 01 Jun 2016 16:15:59 -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=pCoJzX4x4r+whMXz/c8cAKgsquxyKvw57CVbOnWFL8g=; b=jyygCiIqKkOiKMsUXG8tMh/0F6umQT81UxBwih9sd2o+iM6zYXyRAfAIXWBlV3HW8k /uP4xVhgnNkgtKRxXbNiThc4CxMcyBBKrBh7kOLeCTrKYTVVlqNfK11Ah2PAaChtwkXl HThTN+WEE++U6dtDHdGRTrHYacB8rF5X7inJE= 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=pCoJzX4x4r+whMXz/c8cAKgsquxyKvw57CVbOnWFL8g=; b=NrtqRWBE4s9LXTQ405JqBgkzA8maDar/dZ4gk39po5FM7t9D2n/tsVmmIdDTP1E6JK SaMLzY5UqDwllYnvqj4Lxso6kRPRBmIPEG1RihAaBTCs34ytegTMZg2jFi0h38O+WCkG wGO5CTNHgDDab/2fij3IEqjyZfwayca91lD4Dt+vvit5ZGx2xTTGdHDbovNOEJ7W8tAp z0QBgXYozqtQ4Abqa16Rn7XEbfoNfNxwc7M/GwG56i/jek2pDA+QyZ0XW4VxjAuc6Joy N6UghuAkTW85MuXbvRlpO02sZc2bt+Nqzw2lKS0Bxc/g62ojtJDR9aVOqc9Mw6hcxwcd 6TNA== X-Gm-Message-State: ALyK8tJWqKBR4D99Syr6wGHFGhVRLlAIoYy+f57HuV3sx5OWfr8R1onFneh4mQiV1g1zHIAN X-Received: by 10.67.5.134 with SMTP id cm6mr804007pad.93.1464822958964; 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.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:15:58 -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, Peter Ujfalusi , Nishanth Menon Subject: [PATCH 22/34] clk: palmas: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:21 -0700 Message-Id: <20160601231533.9354-23-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: Peter Ujfalusi Cc: Nishanth Menon Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-palmas.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c index 8328863cb0e0..31f590cea493 100644 --- a/drivers/clk/clk-palmas.c +++ b/drivers/clk/clk-palmas.c @@ -41,7 +41,6 @@ struct palmas_clk32k_desc { struct palmas_clock_info { struct device *dev; - struct clk *clk; struct clk_hw hw; struct palmas *palmas; const struct palmas_clk32k_desc *clk_desc; @@ -218,7 +217,7 @@ static int palmas_clks_init_configure(struct palmas_clock_info *cinfo) } if (cinfo->ext_control_pin) { - ret = clk_prepare(cinfo->clk); + ret = clk_prepare(cinfo->hw.clk); if (ret < 0) { dev_err(cinfo->dev, "Clock prep failed, %d\n", ret); return ret; @@ -242,7 +241,6 @@ static int palmas_clks_probe(struct platform_device *pdev) struct device_node *node = pdev->dev.of_node; const struct palmas_clks_of_match_data *match_data; struct palmas_clock_info *cinfo; - struct clk *clk; int ret; match_data = of_device_get_match_data(&pdev->dev); @@ -261,22 +259,20 @@ static int palmas_clks_probe(struct platform_device *pdev) cinfo->clk_desc = &match_data->desc; cinfo->hw.init = &match_data->init; - clk = devm_clk_register(&pdev->dev, &cinfo->hw); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); + ret = devm_clk_hw_register(&pdev->dev, &cinfo->hw); + if (ret) { dev_err(&pdev->dev, "Fail to register clock %s, %d\n", match_data->desc.clk_name, ret); return ret; } - cinfo->clk = clk; ret = palmas_clks_init_configure(cinfo); if (ret < 0) { dev_err(&pdev->dev, "Clock config failed, %d\n", ret); return ret; } - ret = of_clk_add_provider(node, of_clk_src_simple_get, cinfo->clk); + ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &cinfo->hw); if (ret < 0) dev_err(&pdev->dev, "Fail to add clock driver, %d\n", ret); return ret;