diff mbox

[2/2] ASoC: fsl_dma: Do not use 'full_name' node reference

Message ID CAOMZO5Cuq0ejHGOqE0W=-=qU-P_=qruKqzHxcVGkFpmEhydC8Q@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam Jan. 7, 2015, 5:47 p.m. UTC
On Wed, Jan 7, 2015 at 3:27 PM, Timur Tabi <timur@tabi.org> wrote:
> Lars-Peter Clausen wrote:
>>>
>>>
>>> -    dma = kzalloc(sizeof(*dma) + strlen(np->full_name), GFP_KERNEL);
>>> +    dma = kzalloc(sizeof(*dma), GFP_KERNEL);
>>
>>
>> This should probably be part of patch 1.
>
>
> I think you're right.

Thanks, so I can do it on a single patch then:

Comments

Timur Tabi Jan. 7, 2015, 5:54 p.m. UTC | #1
Fabio Estevam wrote:
> -        dev_err(&pdev->dev, "could not determine resources for %s\n",
> -            ssi_np->full_name);
> +        dev_err(&pdev->dev, "could not determine resources: %d\n", ret);

I remember now why I did this, and I might need to NACK this patch. 
ssi_np->full_name is the name of the SSI node, but here, dev_err will 
print the name of the DMA node.  So the intent is to help the user 
determine which SSI node has a broken DMA node pointer.  This probably 
is useful only on PowerPC, which uses the old ssi->dma linkage.
diff mbox

Patch

diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 93d7e56..72e7979 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -63,7 +63,6 @@  struct dma_object {
     struct ccsr_dma_channel __iomem *channel;
     unsigned int irq;
     bool assigned;
-    char path[1];
 };

 /*
@@ -897,20 +896,18 @@  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);
+        dev_err(&pdev->dev, "could not determine resources: %d\n", ret);
         of_node_put(ssi_np);
         return ret;
     }

-    dma = kzalloc(sizeof(*dma) + strlen(np->full_name), GFP_KERNEL);
+    dma = kzalloc(sizeof(*dma), GFP_KERNEL);
     if (!dma) {
         dev_err(&pdev->dev, "could not allocate dma object\n");
         of_node_put(ssi_np);
         return -ENOMEM;
     }

-    strcpy(dma->path, np->full_name);
     dma->dai.ops = &fsl_dma_ops;
     dma->dai.pcm_new = fsl_dma_new;
     dma->dai.pcm_free = fsl_dma_free_dma_buffers;