summaryrefslogtreecommitdiff
path: root/drivers/dma/of-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/of-dma.c')
-rw-r--r--drivers/dma/of-dma.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
index 8266893fef45..2882403a39cf 100644
--- a/drivers/dma/of-dma.c
+++ b/drivers/dma/of-dma.c
@@ -221,12 +221,13 @@ struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
ofdma = of_dma_get_controller(&dma_spec);
- if (!ofdma)
- continue;
-
- chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
+ if (ofdma) {
+ chan = ofdma->of_dma_xlate(&dma_spec, ofdma);
- of_dma_put_controller(ofdma);
+ of_dma_put_controller(ofdma);
+ } else {
+ chan = NULL;
+ }
of_node_put(dma_spec.np);