From: Chris Ball <cjb@laptop.org>
To: Rob Herring <robherring2@gmail.com>
Cc: Mitch Bradley <wmb@laptop.org>,
mturquette@linaro.org, devicetree-discuss@lists.ozlabs.org,
sboyd@codeaurora.org, linux-kernel@vger.kernel.org,
Rob Herring <rob.herring@calxeda.com>,
Grant Likely <grant.likely@secretlab.ca>,
skannan@codeaurora.org, shawn.guo@linaro.org,
s.hauer@pengutronix.de, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/02] clk: clk-of: Use alloc_bootmem() instead of kzalloc()
Date: Thu, 21 Jun 2012 03:32:04 -0400 [thread overview]
Message-ID: <87395p15or.fsf_-_@octavius.laptop.org> (raw)
In-Reply-To: <87bokd15x7.fsf@octavius.laptop.org> (Chris Ball's message of "Thu, 21 Jun 2012 03:27:00 -0400")
When of_clk_add_provider() is used at boot time (during .init_early on
ARM, in the motivating case for this patch), kzalloc() cannot be used
because slab isn't up yet.
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/clk/clk-of.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-of.c b/drivers/clk/clk-of.c
index 8b43416..adbb56b 100644
--- a/drivers/clk/clk-of.c
+++ b/drivers/clk/clk-of.c
@@ -22,6 +22,7 @@
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/of.h>
+#include <linux/bootmem.h>
#ifdef CONFIG_OF
@@ -67,7 +68,7 @@ int of_clk_add_provider(struct device_node *np,
{
struct of_clk_provider *cp;
- cp = kzalloc(sizeof(struct of_clk_provider), GFP_KERNEL);
+ cp = alloc_bootmem(sizeof(struct of_clk_provider));
if (!cp)
return -ENOMEM;
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2012-06-21 7:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-12 14:41 [PATCH v3 0/4] DT clock bindings Rob Herring
2012-06-12 14:41 ` [PATCH v3 1/4] clk: add DT clock binding support Rob Herring
2012-06-15 3:17 ` Shawn Guo
2012-06-15 4:32 ` Rob Herring
2012-07-01 22:13 ` [PATCH v6] " Rob Herring
2012-06-12 14:41 ` [PATCH v3 2/4] clk: add DT fixed-clock " Rob Herring
2012-06-12 14:41 ` [PATCH v3 3/4] dt: add clock binding doc to primecell bindings Rob Herring
2012-06-12 14:41 ` [PATCH v3 4/4] clk: add highbank clock support Rob Herring
2012-06-12 15:47 ` [PATCH v3 0/4] DT clock bindings Mike Turquette
2012-06-12 16:23 ` Rob Herring
2012-06-14 8:49 ` Shawn Guo
2012-06-13 15:26 ` Peter De Schrijver
2012-06-13 18:09 ` Rob Herring
2012-06-15 8:39 ` Shawn Guo
2012-06-15 15:40 ` Stephen Warren
2012-06-15 21:07 ` Rob Herring
2012-06-21 7:27 ` Chris Ball
2012-06-21 7:30 ` [PATCH 01/02] clk: Refactor of_clk_* into a new clk-of.c Chris Ball
2012-06-21 7:32 ` Chris Ball [this message]
2012-06-21 12:18 ` [PATCH 02/02] clk: clk-of: Use alloc_bootmem() instead of kzalloc() Paul Mundt
2012-06-21 15:00 ` [PATCH v3 0/4] DT clock bindings Rob Herring
2012-06-21 17:54 ` Mike Turquette
2012-06-27 12:54 ` Rob Herring
2012-07-03 1:30 ` Turquette, Mike
2012-07-03 2:37 ` Rob Herring
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=87395p15or.fsf_-_@octavius.laptop.org \
--to=cjb@laptop.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=rob.herring@calxeda.com \
--cc=robherring2@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@codeaurora.org \
--cc=shawn.guo@linaro.org \
--cc=skannan@codeaurora.org \
--cc=wmb@laptop.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