From patchwork Wed Jun 1 23:15:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148721 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 083F060751 for ; Wed, 1 Jun 2016 23:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF36126FA0 for ; Wed, 1 Jun 2016 23:22:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3E6C271E0; Wed, 1 Jun 2016 23:22:21 +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=ham 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 6D52626FA0 for ; Wed, 1 Jun 2016 23:22:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbcFAXP5 (ORCPT ); Wed, 1 Jun 2016 19:15:57 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33169 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbcFAXPx (ORCPT ); Wed, 1 Jun 2016 19:15:53 -0400 Received: by mail-pf0-f175.google.com with SMTP id b124so23337162pfb.0 for ; Wed, 01 Jun 2016 16:15:52 -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=/WO1XvuibDB6BHxUu4/NUrJIjLy5/a9c4XrOF51e6pY=; b=TK1R8Vr90c4Mqg2YZDUeJDMBf0vzAzBwq5KzilRKKoZZ+6spMCnG9tWqt1zjYMcFMu b6SJpsI5XPS56q/IcHSTI+opnxGiAb+6I9zMzdowOYFCMZgRw3zD7aFq/h6bol2PtPYJ mPWo6IY1mGzWTlviFvYbsQKp1Ylb1gztl77Q4= 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=/WO1XvuibDB6BHxUu4/NUrJIjLy5/a9c4XrOF51e6pY=; b=EkzliHakj2WYg7Rd4MZCRoMMckQBK4VcUyxggVfKyRcm3vehwFzP//0dythLSoxFQ0 rfMuWpu3isNZdQS5fi9lFvQ19Juwl5yloJGlhYh6Ne4+ujbBnAv/ZNcXjrqY3ih3xuto 4AcanSf4KvT5VD7BFzttV2+tDPQ6mGw6Wct9B+D68d/3qIuDBOyDW1LXQvirEW62pepQ M5vrjdWXBRGCJMxjxyKtFQ44mKl2HAb6/aSDuiPcSoEzrbqAOltGXCc1qodeis7j1n8c VIBf0oWV01ffq7UMudIja/YZ0BYDLGs292inRS2kmAn1a+fgSSxizoSauV7oOP+b7xA8 OSgw== X-Gm-Message-State: ALyK8tIIkZP4EaSwMhuaSo87lOr1z2qFAJuBoccHFOX19iCX6o2EUF276nyIFa1wFKv0R1K2 X-Received: by 10.98.94.194 with SMTP id s185mr13557259pfb.32.1464822951455; Wed, 01 Jun 2016 16:15:51 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:15:50 -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, Kuninori Morimoto Subject: [PATCH 14/34] clk: cs2000: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:13 -0700 Message-Id: <20160601231533.9354-15-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: Kuninori Morimoto Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-cs2000-cp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index 7379de8dc894..021f3daf34e1 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c @@ -59,7 +59,6 @@ struct cs2000_priv { struct i2c_client *client; struct clk *clk_in; struct clk *ref_clk; - struct clk *clk_out; }; static const struct of_device_id cs2000_of_match[] = { @@ -371,7 +370,6 @@ static int cs2000_clk_register(struct cs2000_priv *priv) struct device_node *np = dev->of_node; struct clk_init_data init; const char *name = np->name; - struct clk *clk; static const char *parent_names[CLK_MAX]; int ch = 0; /* it uses ch0 only at this point */ int rate; @@ -400,18 +398,16 @@ static int cs2000_clk_register(struct cs2000_priv *priv) priv->hw.init = &init; - clk = clk_register(dev, &priv->hw); - if (IS_ERR(clk)) - return PTR_ERR(clk); + ret = clk_hw_register(dev, &priv->hw); + if (ret) + return ret; - ret = of_clk_add_provider(np, of_clk_src_simple_get, clk); + ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &priv->hw); if (ret < 0) { - clk_unregister(clk); + clk_hw_unregister(&priv->hw); return ret; } - priv->clk_out = clk; - return 0; } @@ -454,7 +450,7 @@ static int cs2000_remove(struct i2c_client *client) of_clk_del_provider(np); - clk_unregister(priv->clk_out); + clk_hw_unregister(&priv->hw); return 0; }