From db90c20901d0cbdb7105f4204a6bc6e8c2ae6834 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Fri, 15 Mar 2013 14:18:20 +0530 Subject: [PATCH] --- yaml --- r: 374663 b: refs/heads/master c: 9a188eb126aa7bf27077ee46fcb914898d6fc281 h: refs/heads/master i: 374661: c9120433e16835454d7f2c4ec38a1cbc97b88c8f 374659: f78b8b1147ead4b3af34ddfb084c76b1315448fe 374655: 821bc6a37da7ad0ce1d5ae95e503a1967d2b6780 v: v3 --- [refs] | 2 +- trunk/drivers/dma/of-dma.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index bc8b98a268fb..0e223bd8f526 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bef29ec508e58bf8b9ec0915de5b0739fb800c91 +refs/heads/master: 9a188eb126aa7bf27077ee46fcb914898d6fc281 diff --git a/trunk/drivers/dma/of-dma.c b/trunk/drivers/dma/of-dma.c index 6036cd08e222..00db454f70d3 100644 --- a/trunk/drivers/dma/of-dma.c +++ b/trunk/drivers/dma/of-dma.c @@ -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__); @@ -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);