Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374663
b: refs/heads/master
c: 9a188eb
h: refs/heads/master
i:
  374661: c912043
  374659: f78b8b1
  374655: 821bc6a
v: v3
  • Loading branch information
Viresh Kumar authored and Vinod Koul committed Apr 15, 2013
1 parent 070df5d commit db90c20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bef29ec508e58bf8b9ec0915de5b0739fb800c91
refs/heads/master: 9a188eb126aa7bf27077ee46fcb914898d6fc281
8 changes: 6 additions & 2 deletions trunk/drivers/dma/of-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ int of_dma_controller_register(struct device_node *np,
{
struct of_dma *ofdma;
int nbcells;
const __be32 *prop;

if (!np || !of_dma_xlate) {
pr_err("%s: not enough information provided\n", __func__);
Expand All @@ -103,8 +104,11 @@ 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) {
prop = of_get_property(np, "#dma-cells", NULL);
if (prop)
nbcells = be32_to_cpup(prop);

if (!prop || !nbcells) {
pr_err("%s: #dma-cells property is missing or invalid\n",
__func__);
kfree(ofdma);
Expand Down

0 comments on commit db90c20

Please sign in to comment.