devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Fernandez <gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
To: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
	Maxime Coquelin
	<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
	Michael Turquette
	<mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	Nicolas Pitre <nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	daniel.thompson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ludovic.barre-qxv4g6HH51o@public.gmane.org,
	olivier.bideau-qxv4g6HH51o@public.gmane.org,
	amelie.delaunay-qxv4g6HH51o@public.gmane.org
Subject: Re: [PATCH v2 5/6] clk: stm32f469: Add QSPI clock
Date: Thu, 20 Oct 2016 17:44:44 +0200	[thread overview]
Message-ID: <ce7829db-a858-2de9-f9e5-89c6642262b1@st.com> (raw)
In-Reply-To: <20161019203228.GC8871-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

Hi Stephen


On 10/19/2016 10:32 PM, Stephen Boyd wrote:
> On 10/14, gabriel.fernandez-qxv4g6HH51o@public.gmane.org wrote:
>> @@ -532,10 +618,42 @@ static struct clk_hw *stm32_register_cclk(struct device *dev, const char *name,
>>   	{ 0 },
>>   };
>>   
>> +struct stm32f4_clk_data {
>> +	const struct stm32f4_gate_data *gates_data;
>> +	const u64 *gates_map;
>> +	int gates_num;
>> +};
>> @@ -549,6 +667,19 @@ static void __init stm32f4_rcc_init(struct device_node *np)
>>   		goto fail;
>>   	}
>>   
>> +	match = of_match_node(stm32f4_of_match, np);
>> +	if (WARN_ON(!match))
>> +		return;
>> +
>> +	data = match->data;
>> +
>> +	clks = kmalloc_array(data->gates_num + END_PRIMARY_CLK,
>> +			sizeof(struct clk_hw *), GFP_KERNEL);
> sizeof(*clks)?
ok

>
>> +	if (!clks)
>> +		goto fail;
>> +
>> +	stm32f4_gate_map = data->gates_map;
>> +
>>   	hse_clk = of_clk_get_parent_name(np, 0);
>>   
>>   	clk_register_fixed_rate_with_accuracy(NULL, "hsi", NULL, 0,
>> @@ -581,11 +712,15 @@ static void __init stm32f4_rcc_init(struct device_node *np)
>>   	clks[FCLK] = clk_hw_register_fixed_factor(NULL, "fclk", "ahb_div",
>>   					       0, 1, 1);
>>   
>> -	for (n = 0; n < ARRAY_SIZE(stm32f4_gates); n++) {
>> -		const struct stm32f4_gate_data *gd = &stm32f4_gates[n];
>> -		unsigned int secondary =
>> -		    8 * (gd->offset - STM32F4_RCC_AHB1ENR) + gd->bit_idx;
>> -		int idx = stm32f4_rcc_lookup_clk_idx(0, secondary);
>> +	for (n = 0; n < data->gates_num; n++) {
>> +		const struct stm32f4_gate_data *gd;
>> +		unsigned int secondary;
>> +		int idx;
>> +
>> +		gd = (struct stm32f4_gate_data *) &data->gates_data[n];
> Why do we cast here? Get rid of const? Perhaps the struct
> shouldn't have const on the member instead?
we don't need cast here.

Thank's Stephen

BR
Gabriel
>
>> +		secondary = 8 * (gd->offset - STM32F4_RCC_AHB1ENR) +
>> +			gd->bit_idx;
>> +		idx = stm32f4_rcc_lookup_clk_idx(0, secondary);
>>   
>>   		if (idx < 0)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-10-20 15:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14  9:18 [PATCH v2 0/6] STM32F4 Add RTC & QSPI clocks gabriel.fernandez
2016-10-14  9:18 ` [PATCH v2 2/6] ARM: dts: stm32f429: add LSI and LSE clocks gabriel.fernandez
     [not found] ` <1476436699-21879-1-git-send-email-gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
2016-10-14  9:18   ` [PATCH v2 1/6] clk: stm32f4: Add LSI & " gabriel.fernandez-qxv4g6HH51o
     [not found]     ` <1476436699-21879-2-git-send-email-gabriel.fernandez-qxv4g6HH51o@public.gmane.org>
2016-10-19 20:24       ` Stephen Boyd
2016-10-20  7:47         ` Gabriel Fernandez
2016-10-20 16:05         ` Gabriel Fernandez
2016-10-14  9:18   ` [PATCH v2 3/6] arm: stmf32: Enable SYSCON gabriel.fernandez-qxv4g6HH51o
2016-10-14  9:18   ` [PATCH v2 4/6] clk: stm32f4: Add RTC clock gabriel.fernandez-qxv4g6HH51o
2016-10-19 20:45     ` Stephen Boyd
2016-10-20  7:50       ` Gabriel Fernandez
     [not found]       ` <20161019204537.GD8871-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-10-20  7:55         ` Gabriel Fernandez
2016-10-14  9:18 ` [PATCH v2 5/6] clk: stm32f469: Add QSPI clock gabriel.fernandez
2016-10-18 14:17   ` Rob Herring
2016-10-19 20:32   ` Stephen Boyd
     [not found]     ` <20161019203228.GC8871-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-10-20 15:44       ` Gabriel Fernandez [this message]
2016-10-14  9:18 ` [PATCH v2 6/6] ARM: dts: stm32f429: " gabriel.fernandez
2016-11-03 16:45   ` Alexandre Torgue
2016-10-18 23:51 ` [PATCH v2 0/6] STM32F4 Add RTC & QSPI clocks Stephen Boyd
2016-10-19  8:34   ` Gabriel Fernandez
     [not found]     ` <d878b846-556d-180b-8ebf-2d06646efb58-qxv4g6HH51o@public.gmane.org>
2016-10-19 20:29       ` Stephen Boyd
2016-10-20  7:52         ` Gabriel Fernandez
2016-11-03  8:52 ` Alexandre Torgue
2016-11-03  8:57   ` Gabriel Fernandez

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=ce7829db-a858-2de9-f9e5-89c6642262b1@st.com \
    --to=gabriel.fernandez-qxv4g6hh51o@public.gmane.org \
    --cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
    --cc=amelie.delaunay-qxv4g6HH51o@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=daniel.thompson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ludovic.barre-qxv4g6HH51o@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=olivier.bideau-qxv4g6HH51o@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.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).