From patchwork Wed Jun 1 23:15:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148735 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 41C9560751 for ; Wed, 1 Jun 2016 23:22:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3467726FA0 for ; Wed, 1 Jun 2016 23:22:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29797271FD; Wed, 1 Jun 2016 23:22:54 +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 D337826FA0 for ; Wed, 1 Jun 2016 23:22:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751773AbcFAXWx (ORCPT ); Wed, 1 Jun 2016 19:22:53 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35776 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbcFAXPz (ORCPT ); Wed, 1 Jun 2016 19:15:55 -0400 Received: by mail-pf0-f175.google.com with SMTP id g64so23332903pfb.2 for ; Wed, 01 Jun 2016 16:15:55 -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=osnEU25owRXxLU9Uo4hPiLOUx+tq5i0gmMMGsuioBXA=; b=Ly3wUbQ6n9rCICJSAhGvtgF0sgvoLFP7zP/YDdeSDQ2hYJh1AinW8pakbmhuFanhML MVHNNdpqRzET/tZBacgvDL/PBXB71gUcWPPhGTwlE4XqA/hLDL49T1fs3zqoFFbTEavG QKN3zdby/mmbqb2/o2UZKtarDdb5MYJBCR8YY= 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=osnEU25owRXxLU9Uo4hPiLOUx+tq5i0gmMMGsuioBXA=; b=CpwvUgk3AO35kWFP4jkLg7jL8pZSOJ3kt0P6dzTRr7cYXfLaqBXZeFXcCY88Fe1p/g fh4E7YfQxp6vju53ZWfoBIiUwyFV6fRuhBxiiwHmF5eYou1pubGQ38We9ys7cavsUWW/ 6PLkEiUMOzD1VBsrNIpaxWxDWT77S6PfOmOwe4aGIdcJuamtvxTTYQ+WYcAiJQk0GROh Xv3Z2oAJwFMOCa4pJsbB3F/YkWy+dzJeCk+IkIfzzDaDWWO8eb32L9AfFOYAasqbiN7y Ck7YgiHG7H5sejJUrPBMLmif+r1cRNyYmYKBLD7I9ya08URCCPTfGK/PmZH7wWfAaYg5 KVbg== X-Gm-Message-State: ALyK8tI02sezoVSmn27M08hqVUJVDfe7QQN+Iv5Nzqm74ZPZjhqb+FY1/EQOrcpR2Ga25K8j X-Received: by 10.98.87.133 with SMTP id i5mr13631543pfj.55.1464822955092; Wed, 01 Jun 2016 16:15:55 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:15:54 -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, Jassi Brar Subject: [PATCH 18/34] clk: mb86s7x: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:17 -0700 Message-Id: <20160601231533.9354-19-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: Jassi Brar Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-mb86s7x.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk-mb86s7x.c b/drivers/clk/clk-mb86s7x.c index e0817754ca3e..2a83a3ff1d09 100644 --- a/drivers/clk/clk-mb86s7x.c +++ b/drivers/clk/clk-mb86s7x.c @@ -327,10 +327,11 @@ static struct clk_ops clk_clc_ops = { .set_rate = clc_set_rate, }; -struct clk *mb86s7x_clclk_register(struct device *cpu_dev) +static struct clk_hw *mb86s7x_clclk_register(struct device *cpu_dev) { struct clk_init_data init; struct cl_clk *clc; + int ret; clc = kzalloc(sizeof(*clc), GFP_KERNEL); if (!clc) @@ -344,14 +345,17 @@ struct clk *mb86s7x_clclk_register(struct device *cpu_dev) init.flags = CLK_GET_RATE_NOCACHE; init.num_parents = 0; - return devm_clk_register(cpu_dev, &clc->hw); + ret = devm_clk_hw_register(cpu_dev, &clc->hw); + if (ret) + return ERR_PTR(ret); + return &clc->hw; } static int mb86s7x_clclk_of_init(void) { int cpu, ret = -ENODEV; struct device_node *np; - struct clk *clk; + struct clk_hw *hw; np = of_find_compatible_node(NULL, NULL, "fujitsu,mb86s70-scb-1.0"); if (!np || !of_device_is_available(np)) @@ -365,12 +369,12 @@ static int mb86s7x_clclk_of_init(void) continue; } - clk = mb86s7x_clclk_register(cpu_dev); - if (IS_ERR(clk)) { + hw = mb86s7x_clclk_register(cpu_dev); + if (IS_ERR(hw)) { pr_err("failed to register cpu%d clock\n", cpu); continue; } - if (clk_register_clkdev(clk, NULL, dev_name(cpu_dev))) { + if (clk_hw_register_clkdev(hw, NULL, dev_name(cpu_dev))) { pr_err("failed to register cpu%d clock lookup\n", cpu); continue; }