[alsa-devel] [PATCH v3] clk: x86: Add Atom PMC platform clocks

Stephen Boyd sboyd at codeaurora.org
Wed Sep 14 23:33:24 CEST 2016


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<----
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


More information about the Alsa-devel mailing list