diff mbox

[v3] clk: x86: Add Atom PMC platform clocks

Message ID 20160914213324.GF7243@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Stephen Boyd Sept. 14, 2016, 9:33 p.m. UTC
On 09/09, Irina Tirdea wrote:
> +
> +static const char **plt_clk_register_parents(struct platform_device *pdev,
> +					     struct clk_plt_data *data,
> +					     const struct pmc_clk *clks)
> +{
> +	const char **parent_names;
> +	int i, err;
> +
> +	data->nparents = 0;
> +	while (clks[data->nparents].name)
> +		data->nparents++;
> +
> +	data->parents = devm_kzalloc(&pdev->dev,
> +				     sizeof(*data->parents) * data->nparents,
> +				     GFP_KERNEL);

This could be devm_kcalloc()

---8<----

Comments

tip-bot for Irina Tirdea Sept. 15, 2016, 3:44 p.m. UTC | #1
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@codeaurora.org]
> Sent: 15 September, 2016 0:33
> To: Tirdea, Irina
> Cc: linux-clk@vger.kernel.org; Michael Turquette; alsa-devel@alsa-project.org; Mark Brown; Takashi Iwai; Bossart, Pierre-louis; Pierre-
> Louis Bossart
> Subject: Re: [PATCH v3] clk: x86: Add Atom PMC platform clocks
> 
> On 09/09, Irina Tirdea wrote:
> > +
> > +static const char **plt_clk_register_parents(struct platform_device *pdev,
> > +					     struct clk_plt_data *data,
> > +					     const struct pmc_clk *clks)
> > +{
> > +	const char **parent_names;
> > +	int i, err;
> > +
> > +	data->nparents = 0;
> > +	while (clks[data->nparents].name)
> > +		data->nparents++;
> > +
> > +	data->parents = devm_kzalloc(&pdev->dev,
> > +				     sizeof(*data->parents) * data->nparents,
> > +				     GFP_KERNEL);
> 
> This could be devm_kcalloc()
> 

OK, will send v4 with this change.

> ---8<----
> diff --git a/drivers/clk/x86/clk-byt-plt.c b/drivers/clk/x86/clk-byt-plt.c
> index 9dbf4b04ae47..7bd6c0dded00 100644
> --- a/drivers/clk/x86/clk-byt-plt.c
> +++ b/drivers/clk/x86/clk-byt-plt.c
> @@ -259,9 +259,8 @@ static const char **plt_clk_register_parents(struct platform_device *pdev,
>  	while (clks[data->nparents].name)
>  		data->nparents++;
> 
> -	data->parents = devm_kzalloc(&pdev->dev,
> -				     sizeof(*data->parents) * data->nparents,
> -				     GFP_KERNEL);
> +	data->parents = devm_kcalloc(&pdev->dev, data->nparents,
> +				     sizeof(*data->parents), GFP_KERNEL);
>  	if (!data->parents) {
>  		err = -ENOMEM;
>  		goto err_out;
> 
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
diff mbox

Patch

diff --git a/drivers/clk/x86/clk-byt-plt.c b/drivers/clk/x86/clk-byt-plt.c
index 9dbf4b04ae47..7bd6c0dded00 100644
--- a/drivers/clk/x86/clk-byt-plt.c
+++ b/drivers/clk/x86/clk-byt-plt.c
@@ -259,9 +259,8 @@  static const char **plt_clk_register_parents(struct platform_device *pdev,
 	while (clks[data->nparents].name)
 		data->nparents++;
 
-	data->parents = devm_kzalloc(&pdev->dev,
-				     sizeof(*data->parents) * data->nparents,
-				     GFP_KERNEL);
+	data->parents = devm_kcalloc(&pdev->dev, data->nparents,
+				     sizeof(*data->parents), GFP_KERNEL);
 	if (!data->parents) {
 		err = -ENOMEM;
 		goto err_out;