dmaengine: of: bail out early if "dmas" property is not present
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 14 Jan 2015 14:16:28 +0000 (15:16 +0100)
committerVinod Koul <vinod.koul@intel.com>
Mon, 26 Jan 2015 06:44:23 +0000 (22:44 -0800)
And don't print an error: not configured is not an error.

Reported-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/of-dma.c

index d5fbeaa1e7ba76f25a20b7d266a26db3c3204c38..ca31f1b45366d232339cbf0ed17d5ee0ee9e0ca5 100644 (file)
@@ -159,6 +159,10 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
                return ERR_PTR(-ENODEV);
        }
 
+       /* Silently fail if there is not even the "dmas" property */
+       if (!of_find_property(np, "dmas", NULL))
+               return ERR_PTR(-ENODEV);
+
        count = of_property_count_strings(np, "dma-names");
        if (count < 0) {
                pr_err("%s: dma-names property of node '%s' missing or empty\n",