[alsa-devel] [PATCH 2/2] ASoC: fsl_dma: Do not use 'full_name' node reference

Lars-Peter Clausen lars at metafoo.de
Wed Jan 7 18:26:45 CET 2015


On 01/07/2015 06:21 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam at freescale.com>
>
> The only usage of 'full_name' is inside an error message, which provides a
> rather verbose node path.
>
> A more concise error message can be obtained by using 'pdev->name' instead.

It's probably best to drop it altogether in that case. dev_err() already 
prints the name of the device.

  It
> also makes the kzalloc calculation simpler, as we don't need to take the length
> of full_name into account.
>
> Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
> ---
> Buit tested only.
>
>   sound/soc/fsl/fsl_dma.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 026da0a..770de20 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -897,12 +897,12 @@ static int fsl_soc_dma_probe(struct platform_device *pdev)
>   	ret = of_address_to_resource(ssi_np, 0, &res);
>   	if (ret) {
>   		dev_err(&pdev->dev, "could not determine resources for %s\n",
> -			ssi_np->full_name);
> +			pdev->name);
>   		of_node_put(ssi_np);
>   		return ret;
>   	}
>
> -	dma = kzalloc(sizeof(*dma) + strlen(np->full_name), GFP_KERNEL);
> +	dma = kzalloc(sizeof(*dma), GFP_KERNEL);

This should probably be part of patch 1.

>   	if (!dma) {
>   		dev_err(&pdev->dev, "could not allocate dma object\n");
>   		of_node_put(ssi_np);
>



More information about the Alsa-devel mailing list