of: dma: make #dma-cells optional
Subsystems (2)
PATCH 1/2 of: dma: make #dma-cells optional
From: Rob Herring <[email protected]>
For controllers with no requests/clients (memory to memory only), the
--- Documentation/devicetree/bindings/dma/dma.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/dma/dma.txt +4 -3
@@ -8,9 +8,10 @@ controller. * DMA controller Required property: -- #dma-cells: Must be at least 1. Used to provide DMA controller - specific information. See DMA client binding below for - more details. +- #dma-cells: Required for controllers with requests. Optional for + memory to memory only DMA controllers. Must be at least + 1. Used to provide DMA controller specific information. + See DMA client binding below for more details. Optional properties: - dma-channels: Number of DMA channels supported by the controller.
Signature · 1 line
1.7.10.4
PATCH 2/2 dma: of: allow for non-existent #dma-cells property
From: Rob Herring <[email protected]>
Allow the #dma-cells property to be optional and default to 0. This fixes a crash on Calxed highbank which has no clients and no #dma-cells property.
Also, the error check was pointless as be32_to_cpup causes a NULL ptr error first before we get to the error check.
--- drivers/dma/of-dma.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/dma/of-dma.c +2 -8
@@ -92,7 +92,7 @@ int of_dma_controller_register(struct device_node *np, void *data) {struct of_dma *ofdma; -int nbcells; +int nbcells =0 ;if (!np || !of_dma_xlate) {pr_err ("%s: not enough information provided\n" , __func__);
@@ -103,13 +103,7 @@ int of_dma_controller_register(struct device_node *np,if (!ofdma)return -ENOMEM ; - nbcells =be32_to_cpup (of_get_property (np,"#dma-cells" ,NULL )); -if (!nbcells) { -pr_err ("%s: #dma-cells property is missing or invalid\n" , - __func__); -kfree (ofdma); -return -EINVAL ; - } +of_property_read_u32 (np,"#dma-cells" , &nbcells); ofdma->of_node = np; ofdma->of_dma_nbcells = nbcells;
Signature · 1 line
1.7.10.4
A message that is not in the archive (sent off-list or not yet received): 1362013078-2213-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Jon Hunter
Acked-byQuoted 3 lines · Rob Herring
From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>
For controllers with no requests/clients (memory to memory only), the
Looks like the changelog got truncated.
Quoted 16 lines
Signed-off-by Rob Herring <rob.herring-bsGFqQB8/[email protected]>Cc Vinod Koul <[email protected]>Cc Dan Williams <[email protected]>Cc Grant Likely <grant.likely-s3s/[email protected]>--- Documentation/devicetree/bindings/dma/dma.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/dma/dma.txt +0
-0@@ -8,9 +8,10 @@ controller. * DMA controller Required property:
Documentation/devicetree/bindings/dma/dma.txt controller. · line 17
Quoted 10 lines
Documentation/devicetree/bindings/dma/dma.txt +4
-3-- #dma-cells: Must be at least 1. Used to provide DMA controller - specific information. See DMA client binding below for - more details. +- #dma-cells: Required for controllers with requests. Optional for + memory to memory only DMA controllers. Must be at least + 1. Used to provide DMA controller specific information. + See DMA client binding below for more details. Optional properties: - dma-channels: Number of DMA channels supported by the controller.
Otherwise ...
Cheers
Jon
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Jon Hunter
Quoted 3 lines · Rob Herring
From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>
For controllers with no requests/clients (memory to memory only), the
Looks like the changelog got truncated.
By the way, may be this was in your original changelog, but I am curious what information the DMA client node in this case? Is it just the dma controller?
Cheers
Jon
Quoted 3 lines · Rob Herring
From: Rob Herring <[email protected]>
For controllers with no requests/clients (memory to memory only), the
Change log is truncated...
Quoted 30 lines
Signed-off-by Rob Herring <[email protected]>Cc Vinod Koul <[email protected]>Cc Dan Williams <[email protected]>Cc Grant Likely <[email protected]>--- Documentation/devicetree/bindings/dma/dma.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/dma/dma.txt +4
-3@@ -8,9 +8,10 @@ controller. * DMA controller Required property: -- #dma-cells: Must be at least 1. Used to provide DMA controller - specific information. See DMA client binding below for - more details. +- #dma-cells: Required for controllers with requests. Optional for + memory to memory only DMA controllers. Must be at least + 1. Used to provide DMA controller specific information. + See DMA client binding below for more details. Optional properties: - dma-channels: Number of DMA channels supported by the controller.Signature · 1 line
1.7.10.4