[v2,1/2] dmaengine: apple-admac: Fix grabbing of channels in of_xlate

Message ID 20221019132324.8585-1-povik+lin@cutebit.org
State New
Headers
Series [v2,1/2] dmaengine: apple-admac: Fix grabbing of channels in of_xlate |

Commit Message

Martin Povišer Oct. 19, 2022, 1:23 p.m. UTC
  The of_xlate callback is supposed to return the channel after already
having 'grabbed' it for private use, so fill that in.

Fixes: b127315d9a78 ("dmaengine: apple-admac: Add Apple ADMAC driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
---
 drivers/dma/apple-admac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Vinod Koul Oct. 19, 2022, 4:54 p.m. UTC | #1
On 19-10-22, 15:23, Martin Povišer wrote:
> The of_xlate callback is supposed to return the channel after already
> having 'grabbed' it for private use, so fill that in.

Applied both, thanks
  

Patch

diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c
index 317ca76ccafd..a2cc520225d3 100644
--- a/drivers/dma/apple-admac.c
+++ b/drivers/dma/apple-admac.c
@@ -493,7 +493,7 @@  static struct dma_chan *admac_dma_of_xlate(struct of_phandle_args *dma_spec,
 		return NULL;
 	}
 
-	return &ad->channels[index].chan;
+	return dma_get_slave_channel(&ad->channels[index].chan);
 }
 
 static int admac_drain_reports(struct admac_data *ad, int channo)