diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-20 09:20:14 (GMT) |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-01-20 09:20:14 (GMT) |
commit | 258753361534a40ad7180c742da813fc659e427b (patch) | |
tree | 58517f6ce46ab2c897d427b7d1bf29850be314fa /drivers/dma/of-dma.c | |
parent | 315fba80a664e4bd928e0b85a38d26e60645b96a (diff) | |
parent | 2aff4c9ce898b9079658650c1ab33c44b100a203 (diff) | |
download | linux-258753361534a40ad7180c742da813fc659e427b.tar.xz |
Merge branch 'for-next' into for-linus
Diffstat (limited to 'drivers/dma/of-dma.c')
-rw-r--r-- | drivers/dma/of-dma.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index 0b88dd3..e8fe9dc 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -143,7 +143,7 @@ static int of_dma_match_channel(struct device_node *np, const char *name, * @np: device node to get DMA request from * @name: name of desired channel * - * Returns pointer to appropriate dma channel on success or NULL on error. + * Returns pointer to appropriate DMA channel on success or an error pointer. */ struct dma_chan *of_dma_request_slave_channel(struct device_node *np, const char *name) @@ -152,17 +152,18 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np, struct of_dma *ofdma; struct dma_chan *chan; int count, i; + int ret_no_channel = -ENODEV; if (!np || !name) { pr_err("%s: not enough information provided\n", __func__); - return 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", __func__, np->full_name); - return NULL; + return ERR_PTR(-ENODEV); } for (i = 0; i < count; i++) { @@ -172,10 +173,12 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np, mutex_lock(&of_dma_lock); ofdma = of_dma_find_controller(&dma_spec); - if (ofdma) + if (ofdma) { chan = ofdma->of_dma_xlate(&dma_spec, ofdma); - else + } else { + ret_no_channel = -EPROBE_DEFER; chan = NULL; + } mutex_unlock(&of_dma_lock); @@ -185,7 +188,7 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np, return chan; } - return NULL; + return ERR_PTR(ret_no_channel); } /** |