From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Ryan.Wanner@microchip.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, nicolas.ferre@microchip.com,
alexandre.belloni@bootlin.com, mturquette@baylibre.com,
sboyd@kernel.org, arnd@arndb.de
Cc: dharma.b@microchip.com, mihai.sain@microchip.com,
romain.sioen@microchip.com, varshini.rajendran@microchip.com,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH v3 08/13] clk: at91: sama7d65: add sama7d65 pmc driver
Date: Sun, 8 Dec 2024 18:44:04 +0200 [thread overview]
Message-ID: <d5d102c0-e4d8-4041-8899-6a732a514046@tuxon.dev> (raw)
In-Reply-To: <c0206c74-33d3-4715-9a01-256394919fc8@wanadoo.fr>
On 08.12.2024 18:35, Christophe JAILLET wrote:
> Le 06/12/2024 à 20:59, Ryan.Wanner@microchip.com a écrit :
>> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>>
>> Add clock support for SAMA7D65 SoC.
>>
>> Increase maximum number of valid master clocks. The PMC for the SAMA7D65
>> requires 9 master clocks.
>>
>> Increase maximum amount of PLLs to 9 to support SAMA7D65 SoC PLL
>> requirements.
>>
>> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
>
> ...
>
>> + for (i = 0; i < ARRAY_SIZE(sama7d65_gck); i++) {
>> + u8 num_parents = 4 + sama7d65_gck[i].pp_count;
>> + struct clk_hw *tmp_parent_hws[8];
>> + u32 *mux_table;
>> +
>> + mux_table = kmalloc_array(num_parents, sizeof(*mux_table),
>> + GFP_KERNEL);
>> + if (!mux_table)
>> + goto err_free;
>> +
>> + PMC_INIT_TABLE(mux_table, 4);
>> + PMC_FILL_TABLE(&mux_table[4], sama7d65_gck[i].pp_mux_table,
>> + sama7d65_gck[i].pp_count);
>> + for (j = 0; j < sama7d65_gck[i].pp_count; j++) {
>> + u8 pll_id = sama7d65_gck[i].pp[j].pll_id;
>> + u8 pll_compid = sama7d65_gck[i].pp[j].pll_compid;
>> +
>> + tmp_parent_hws[j] = sama7d65_plls[pll_id][pll_compid].hw;
>> + }
>> + PMC_FILL_TABLE(&parent_hws[4], tmp_parent_hws,
>> + sama7d65_gck[i].pp_count);
>> +
>> + hw = at91_clk_register_generated(regmap, &pmc_pcr_lock,
>> + &sama7d65_pcr_layout,
>> + sama7d65_gck[i].n, NULL,
>> + parent_hws, mux_table,
>> + num_parents,
>> + sama7d65_gck[i].id,
>> + &sama7d65_gck[i].r,
>> + sama7d65_gck[i].pp_chg_id);
>> + if (IS_ERR(hw))
>
> If we fail here, mux_table is not freed, because it is not stored yet in
> alloc_mem.
You're right! I missed that.
next prev parent reply other threads:[~2024-12-08 16:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 19:59 [PATCH v3 00/13] Add support for SAMA7D65 Ryan.Wanner
2024-12-06 19:59 ` [PATCH v3 01/13] dt-bindings: ARM: at91: Document Microchip SAMA7D65 Curiosity Ryan.Wanner
2024-12-08 16:23 ` Claudiu Beznea
2024-12-06 19:59 ` [PATCH v3 02/13] dt-bindings: mfd: atmel,sama5d2-flexcom: add microchip,sama7d65-flexcom Ryan.Wanner
2024-12-08 14:16 ` Krzysztof Kozlowski
2024-12-06 19:59 ` [PATCH v3 03/13] dt-bindings: atmel-sysreg: add sama7d65 RAM and PIT Ryan.Wanner
2024-12-08 16:24 ` Claudiu Beznea
2024-12-11 16:16 ` Rob Herring (Arm)
2024-12-06 19:59 ` [PATCH v3 04/13] dt-bindings: serial: atmel,at91-usart: add microchip,sama7d65-usart Ryan.Wanner
2024-12-11 16:16 ` Rob Herring (Arm)
2024-12-06 19:59 ` [PATCH v3 05/13] dt-bindings: pinctrl: at91-pio4: add microchip,sama7d65-pinctrl Ryan.Wanner
2024-12-11 16:16 ` Rob Herring (Arm)
2024-12-06 19:59 ` [PATCH v3 06/13] dt-bindings: clocks: atmel,at91sam9x5-sckc: add sama7d65 Ryan.Wanner
2024-12-08 16:25 ` Claudiu Beznea
2024-12-06 19:59 ` [PATCH v3 07/13] dt-bindings: clock: Add SAMA7D65 PMC compatible string Ryan.Wanner
2024-12-08 16:26 ` Claudiu Beznea
2024-12-10 16:46 ` Rob Herring
2024-12-11 15:25 ` Ryan Wanner
2024-12-12 8:17 ` Krzysztof Kozlowski
2024-12-12 8:17 ` Krzysztof Kozlowski
2024-12-06 19:59 ` [PATCH v3 08/13] clk: at91: sama7d65: add sama7d65 pmc driver Ryan.Wanner
2024-12-08 16:27 ` Claudiu Beznea
2024-12-08 16:35 ` Christophe JAILLET
2024-12-08 16:44 ` Claudiu Beznea [this message]
2024-12-06 19:59 ` [PATCH v3 09/13] ARM: dts: microchip: add sama7d65 SoC DT Ryan.Wanner
2024-12-08 16:28 ` Claudiu Beznea
2024-12-08 16:29 ` Claudiu Beznea
2024-12-06 19:59 ` [PATCH v3 10/13] ARM: dts: at91: Add sama7d65 pinmux Ryan.Wanner
2024-12-08 16:30 ` Claudiu Beznea
2024-12-06 19:59 ` [PATCH v3 11/13] ARM: dts: microchip: add support for sama7d65_curiosity board Ryan.Wanner
2024-12-08 16:32 ` Claudiu Beznea
2024-12-09 4:55 ` kernel test robot
2024-12-06 19:59 ` [PATCH v3 12/13] ARM: configs: at91: sama7: add new SoC config Ryan.Wanner
2024-12-08 16:33 ` Claudiu Beznea
2024-12-06 19:59 ` [PATCH v3 13/13] ARM: at91: add new SoC sama7d65 Ryan.Wanner
2024-12-08 16:34 ` Claudiu Beznea
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=d5d102c0-e4d8-4041-8899-6a732a514046@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=Ryan.Wanner@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dharma.b@microchip.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mihai.sain@microchip.com \
--cc=mturquette@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=robh@kernel.org \
--cc=romain.sioen@microchip.com \
--cc=sboyd@kernel.org \
--cc=varshini.rajendran@microchip.com \
/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