From patchwork Wed Jun 1 23:15:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148621 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 3B7D460751 for ; Wed, 1 Jun 2016 23:16:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E54E2714B for ; Wed, 1 Jun 2016 23:16:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 233F427224; Wed, 1 Jun 2016 23:16:40 +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 66966271E0 for ; Wed, 1 Jun 2016 23:16:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752398AbcFAXQP (ORCPT ); Wed, 1 Jun 2016 19:16:15 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:34164 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343AbcFAXQL (ORCPT ); Wed, 1 Jun 2016 19:16:11 -0400 Received: by mail-pf0-f174.google.com with SMTP id 62so23303531pfd.1 for ; Wed, 01 Jun 2016 16:16:06 -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 :mime-version:content-transfer-encoding; bh=XwCCV3rmiO7dzJ49VaEssyAVciq+OS6ACMzysVu17a8=; b=i445b5Hd7cB5V6rhwnsAow6xfA5rzo+ZHnVwV4n36kwzx6G80DtzA2aPSI4T0Cy1ds XbaqyY51+AZ3/g5ko6oo1HgUzgqkZ/+vCBfB7VQOhaAhg9A45ubFAHESS07BW3zMHxli R1crJgk+XpmjdW1p+sqDbufeuA+xIrFR4SZuI= 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:mime-version:content-transfer-encoding; bh=XwCCV3rmiO7dzJ49VaEssyAVciq+OS6ACMzysVu17a8=; b=G2+6jPSB8WTRKkxccBroimRgVCJG/+dfy3qbs6+wCPlY4Pgln1386fL5OM82D5Q1qP E6gionZwXMRJmIyFGgIRFdHSMeCVsxa/g/OzfdSHZeYfScWlSqHQik3JNTaGCycB0BiI ayqVgU6+OnwA/mlEIiZIveRl4UixYlRbFeMsNXyqaJtsCFT8qYe0z/3XAuFuGFzoVF7n R6FFOKh6ts3jm0S9FuNwJbbIxvU9ORhkJnfW+tIgeA8ZgPbrJ3hkxwjgNrY9WhWGLFCq S6E7GcnvK8Tn4wZkBQUPVcaNn6xWZwKkWwqSLU8oyBtHqIHgVKhU90LnT70ILxGbJzSe 5pJg== X-Gm-Message-State: ALyK8tIrgE7KN2WBH5In6qaSn6ZUYeK6Ct34G2CQ+mOn6m8kX1PrXc32e8NkV6taJ0M7Qebj X-Received: by 10.98.36.140 with SMTP id k12mr13623298pfk.118.1464822965653; Wed, 01 Jun 2016 16:16:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:16:05 -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, Guenter Roeck , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= Subject: [PATCH 29/34] clk: si570: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:28 -0700 Message-Id: <20160601231533.9354-30-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> MIME-Version: 1.0 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: Guenter Roeck Cc: Sören Brinkmann Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-si570.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk-si570.c b/drivers/clk/clk-si570.c index d56648521a95..646af1d1898d 100644 --- a/drivers/clk/clk-si570.c +++ b/drivers/clk/clk-si570.c @@ -408,7 +408,6 @@ static int si570_probe(struct i2c_client *client, { struct clk_si570 *data; struct clk_init_data init; - struct clk *clk; u32 initial_fout, factory_fout, stability; int err; enum clk_si570_variant variant = id->driver_data; @@ -462,13 +461,13 @@ static int si570_probe(struct i2c_client *client, if (err) return err; - clk = devm_clk_register(&client->dev, &data->hw); - if (IS_ERR(clk)) { + err = devm_clk_hw_register(&client->dev, &data->hw); + if (err) { dev_err(&client->dev, "clock registration failed\n"); - return PTR_ERR(clk); + return err; } - err = of_clk_add_provider(client->dev.of_node, of_clk_src_simple_get, - clk); + err = of_clk_add_hw_provider(client->dev.of_node, of_clk_hw_simple_get, + &data->hw); if (err) { dev_err(&client->dev, "unable to add clk provider\n"); return err; @@ -477,7 +476,7 @@ static int si570_probe(struct i2c_client *client, /* Read the requested initial output frequency from device tree */ if (!of_property_read_u32(client->dev.of_node, "clock-frequency", &initial_fout)) { - err = clk_set_rate(clk, initial_fout); + err = clk_set_rate(data->hw.clk, initial_fout); if (err) { of_clk_del_provider(client->dev.of_node); return err;