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: 69107 Delivered-To: patch@linaro.org Received: by 10.140.23.41 with SMTP id 38csp54276qgo; Wed, 1 Jun 2016 16:21:27 -0700 (PDT) X-Received: by 10.98.55.129 with SMTP id e123mr13706756pfa.145.1464823287212; Wed, 01 Jun 2016 16:21:27 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id h132si2889005pfe.212.2016.06.01.16.21.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 16:21:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8FPE-0007rO-Lb; Wed, 01 Jun 2016 23:18:32 +0000 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8FMy-0005G4-8T for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2016 23:16:14 +0000 Received: by mail-pf0-x22f.google.com with SMTP id 62so23301612pfd.1 for ; Wed, 01 Jun 2016 16:15:51 -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=H6R3WUc6seOgsp/Rdf2qxjB6O/zN2G60MaX/+GWtvf5UvEKQAWbLjSCdzG0Xk9vvah WW20lYk8fx2Ou9nagmspiH6vDvtuSfja2rnlt0LfU2Pzhk+nRg0S4bGynzQGV5ZRTvu6 zvdHxb9OOG49lpBioelxMEG05WBxyuvMQVMbyYI/YvQCcUdciGtVoZtpxTmR7Q6P1ku0 PFWWICk+hOFboo3gp82Vg9s3r9BRYbLPFqnfUaDBzjFr5YGmvvKjfLP59UdDCLn4igND Vw/ezZdGcQ5N7vsHFX/8pt56aaGd1Lo9IOhQOq+ibHrByHf/07B85LHI1E8XKxNok127 kz2Q== X-Gm-Message-State: ALyK8tLNdNTCh/pGE8XWf/8VHKOTMTpQ93euCe8NxpUQ2aSR/8sG1KOpjBG968emSQVbWXBI 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160601_161612_515228_9A8842FC X-CRM114-Status: GOOD ( 15.77 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kuninori Morimoto , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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: 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(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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; }