| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- From 74f03104ed465ff71b11076ef620e4eaa53dbf74 Mon Sep 17 00:00:00 2001
- From: Christoph Hellwig <[email protected]>
- Date: Fri, 1 Feb 2019 09:47:44 +0100
- Subject: [PATCH] MIPS: lantiq: pass struct device to DMA API functions
- The DMA API generally relies on a struct device to work properly, and
- only barely works without one for legacy reasons. Pass the easily
- available struct device from the platform_device to remedy this.
- Also use GFP_KERNEL instead of GFP_ATOMIC as the gfp_t for the memory
- allocation, as we aren't in interrupt context or under a lock.
- Note that this whole function looks somewhat bogus given that we never
- even look at the returned dma address, and the CPHYSADDR magic on
- a returned noncached mapping looks "interesting". But I'll leave
- that to people more familiar with the code to sort out.
- Signed-off-by: Christoph Hellwig <[email protected]>
- Signed-off-by: Paul Burton <[email protected]>
- Cc: John Crispin <[email protected]>
- Cc: Vinod Koul <[email protected]>
- Cc: Dmitry Tarnyagin <[email protected]>
- Cc: Nicolas Ferre <[email protected]>
- Cc: Sudip Mukherjee <[email protected]>
- Cc: Felipe Balbi <[email protected]>
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- ---
- arch/mips/lantiq/xway/vmmc.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
- --- a/arch/mips/lantiq/xway/vmmc.c
- +++ b/arch/mips/lantiq/xway/vmmc.c
- @@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_de
- dma_addr_t dma;
-
- cp1_base =
- - (void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE,
- - &dma, GFP_ATOMIC));
- + (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
- + &dma, GFP_KERNEL));
-
- gpio_count = of_gpio_count(pdev->dev.of_node);
- while (gpio_count > 0) {
|