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: 9148793 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 CDEDD600BC for ; Wed, 1 Jun 2016 23:25:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C058F26FA0 for ; Wed, 1 Jun 2016 23:25:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4EA9271F1; Wed, 1 Jun 2016 23:25:50 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 691C526FA0 for ; Wed, 1 Jun 2016 23:25:50 +0000 (UTC) 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 1b8FU0-0007wY-9p; Wed, 01 Jun 2016 23:23:28 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8FNG-0005VQ-01 for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Jun 2016 23:16:30 +0000 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]) by casper.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1b8FNE-0008VH-7T for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2016 23:16:28 +0000 Received: by mail-pf0-x233.google.com with SMTP id b124so23338915pfb.0 for ; Wed, 01 Jun 2016 16:16:07 -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=XxDqilZT6fldCLLd0SR7RcgaKTvvtSPr2OxxngD7J8UdCykvY5ixdzNXQUftcwLEpf JrPe+o4YEQjq6P9ulPfioXsI8HZzzYdsZF2ggbjK8zus4diwQk9KZQXEWgFNQEQyQyGZ j4OuGDkVQ0Kc3vyoZq7bT2MA06XExsocTyINSF5mBAzUux3kArPUPYuqfyUj9jT7ow/N fw6E1ns3knXL5IYDJ6gRE5CpR3pNAXBQFzqrPlGY6izvhUnVfahn2ZuxkpC4z7XgRYdC 1l9LwJQ5/3gqR2I5NXYMF8r5cGKjcYQ7bYajloodBFZA0OXP0niMxzqpyNYkYvmUsELG 0upQ== X-Gm-Message-State: ALyK8tLWSm1doBR3MKMVb1UiQ8SCrQl156vujc+KXsQqC62Zagn+J6Hn0NQP3w6G7c+Xv14d 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160602_001628_438936_544310D5 X-CRM114-Status: GOOD ( 16.64 ) 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: =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Guenter Roeck , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;