linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: david@lechnology.com (David Lechner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] clk: hisilicon: make use of clk_alloc_onecell_data()
Date: Thu,  4 Jan 2018 18:38:09 -0600	[thread overview]
Message-ID: <1515112695-3160-5-git-send-email-david@lechnology.com> (raw)
In-Reply-To: <1515112695-3160-1-git-send-email-david@lechnology.com>

Use helper function clk_alloc_onecell_data() to allocate struct
clk_onecell_data.

Signed-off-by: David Lechner <david@lechnology.com>
---
 drivers/clk/hisilicon/clk-hi3620.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c
index 77072c7..15f8d50 100644
--- a/drivers/clk/hisilicon/clk-hi3620.c
+++ b/drivers/clk/hisilicon/clk-hi3620.c
@@ -476,21 +476,16 @@ static void __init hi3620_mmc_clk_init(struct device_node *node)
 		return;
 	}
 
-	clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
+	clk_data = clk_alloc_onecell_data(num);
 	if (WARN_ON(!clk_data))
 		return;
 
-	clk_data->clks = kcalloc(num, sizeof(*clk_data->clks), GFP_KERNEL);
-	if (!clk_data->clks)
-		return;
-
 	for (i = 0; i < num; i++) {
 		struct hisi_mmc_clock *mmc_clk = &hi3620_mmc_clks[i];
 		clk_data->clks[mmc_clk->id] =
 			hisi_register_clk_mmc(mmc_clk, base, node);
 	}
 
-	clk_data->clk_num = num;
 	of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
 }
 
-- 
2.7.4

  parent reply	other threads:[~2018-01-05  0:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05  0:38 [PATCH 0/7] clk: add helper functions for managing clk_onecell_data David Lechner
2018-01-05  0:38 ` [PATCH 1/7] " David Lechner
2018-01-05  0:38 ` [PATCH 2/7] clk: mediatek: make use of clk_alloc_onecell_data() David Lechner
2018-01-05  0:38 ` [PATCH 3/7] clk: qoriq: " David Lechner
2018-01-05  0:38 ` David Lechner [this message]
2018-01-05  0:38 ` [PATCH 5/7] clk: rockchip: " David Lechner
2018-01-05  0:38 ` [PATCH 6/7] clk: st: " David Lechner
2018-01-05  0:38 ` [PATCH 7/7] clk: sunxi: " David Lechner
2018-03-16 22:29 ` [PATCH 0/7] clk: add helper functions for managing clk_onecell_data Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515112695-3160-5-git-send-email-david@lechnology.com \
    --to=david@lechnology.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).