From patchwork Wed Jun 1 23:15:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148675 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 E677A60751 for ; Wed, 1 Jun 2016 23:20:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7096271CB for ; Wed, 1 Jun 2016 23:20:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9362271F1; Wed, 1 Jun 2016 23:20:06 +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 4B7E4271CB for ; Wed, 1 Jun 2016 23:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751513AbcFAXTi (ORCPT ); Wed, 1 Jun 2016 19:19:38 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34154 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752133AbcFAXQC (ORCPT ); Wed, 1 Jun 2016 19:16:02 -0400 Received: by mail-pf0-f171.google.com with SMTP id 62so23303009pfd.1 for ; Wed, 01 Jun 2016 16:16:02 -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=00VAdBt+hoRHWu2RQztMhiFIMfXIbVieIyZ7z1wg+Mo=; b=j7kzv0M02PZJ4d42ol6v6jyq9ZyUzOS7MZgyYciUnWHFjn3dY81K5OkCdIGiaKMaJf Pwh7zz4nX+vk/GiQa9oKXmKBR3oB3IYJ0gkagvfzHtxu7h1f1WNJtS1gBOlE60sVQ4hz X20WD9TydJq9ozqlaucNpTWxRilsr4ViVp1LU= 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=00VAdBt+hoRHWu2RQztMhiFIMfXIbVieIyZ7z1wg+Mo=; b=LQrIYVjauaT8t2sPof9+xHa+ryshYWpR1iBZzTNSAhWTt/cP9eMC2WTOitKkMpB76A VZ5bpWoeFVmTON8XlK/gd/6x6wdIR648im9R8TiIbfauGoiHSBaobN8eHdg3toBD4Afu PLIidT4NSreKM+uLsBFZsqmAXHDx00twFENaziipqGATETBpvyImZb5xqzhr0q4bS9TF /twj/qHd3CQOED/lYZSnw62d15HRem9CX64NrV3b3m1/1fYhzhyMS7DVoHr9MNxLDCkP YFFBmXn7A/zO1Rh+UyVH4uRBawh4qVGZTIr39hHBSKzAIumWDehs36t+Sr+/FjiTHNWs RMPQ== X-Gm-Message-State: ALyK8tLW9ctyWSs2wBtBeoxde3wGb0j5+097hs8I16ur4MSsqkzr8V1A2I7rZJ7ef4xjxuzg X-Received: by 10.98.22.211 with SMTP id 202mr13702533pfw.74.1464822961803; Wed, 01 Jun 2016 16:16:01 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:16:01 -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, Andi Shyti , Krzysztof Kozlowski Subject: [PATCH 25/34] clk: s2mps11: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:24 -0700 Message-Id: <20160601231533.9354-26-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: Andi Shyti Cc: Krzysztof Kozlowski Signed-off-by: Stephen Boyd Reviewed-by: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski Acked-by: Andi Shyti --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-s2mps11.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index f8c83977c7fa..fbaa84a33c46 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -137,7 +137,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev) { struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); struct s2mps11_clk *s2mps11_clks; - struct clk_onecell_data *clk_data; + struct clk_hw_onecell_data *clk_data; unsigned int s2mps11_reg; int i, ret = 0; enum sec_device_type hwid = platform_get_device_id(pdev)->driver_data; @@ -147,15 +147,12 @@ static int s2mps11_clk_probe(struct platform_device *pdev) if (!s2mps11_clks) return -ENOMEM; - clk_data = devm_kzalloc(&pdev->dev, sizeof(*clk_data), GFP_KERNEL); + clk_data = devm_kzalloc(&pdev->dev, sizeof(*clk_data) + + sizeof(*clk_data->hws) * S2MPS11_CLKS_NUM, + GFP_KERNEL); if (!clk_data) return -ENOMEM; - clk_data->clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM, - sizeof(struct clk *), GFP_KERNEL); - if (!clk_data->clks) - return -ENOMEM; - switch (hwid) { case S2MPS11X: s2mps11_reg = S2MPS11_REG_RTC_CTRL; @@ -196,18 +193,18 @@ static int s2mps11_clk_probe(struct platform_device *pdev) goto err_reg; } - s2mps11_clks[i].lookup = clkdev_create(s2mps11_clks[i].clk, + s2mps11_clks[i].lookup = clkdev_hw_create(&s2mps11_clks[i].hw, s2mps11_clks_init[i].name, NULL); if (!s2mps11_clks[i].lookup) { ret = -ENOMEM; goto err_reg; } - clk_data->clks[i] = s2mps11_clks[i].clk; + clk_data->hws[i] = &s2mps11_clks[i].hw; } - clk_data->clk_num = S2MPS11_CLKS_NUM; - of_clk_add_provider(s2mps11_clks->clk_np, of_clk_src_onecell_get, - clk_data); + clk_data->num = S2MPS11_CLKS_NUM; + of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get, + clk_data); platform_set_drvdata(pdev, s2mps11_clks);