brcm2708: switch to linux 4.9
[lede.git] / target / linux / brcm2708 / patches-4.4 / 0546-fb-Use-struct-device-for-dma_alloc_coherent.patch
1 From 6661c06cfe9c5cc937ed662ed0463bd74e7d098e Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Thu, 17 Nov 2016 16:49:33 +0000
4 Subject: [PATCH] fb: Use struct device for dma_alloc_coherent
5
6 ---
7  drivers/video/fbdev/bcm2708_fb.c | 4 ++--
8  1 file changed, 2 insertions(+), 2 deletions(-)
9
10 --- a/drivers/video/fbdev/bcm2708_fb.c
11 +++ b/drivers/video/fbdev/bcm2708_fb.c
12 @@ -507,7 +507,7 @@ static long vc_mem_copy(struct bcm2708_f
13                 return -EFAULT;
14         }
15  
16 -       buf = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &bus_addr,
17 +       buf = dma_alloc_coherent(fb->fb.device, PAGE_ALIGN(size), &bus_addr,
18                                  GFP_ATOMIC);
19         if (!buf) {
20                 pr_err("[%s]: failed to dma_alloc_coherent(%d)\n",
21 @@ -531,7 +531,7 @@ static long vc_mem_copy(struct bcm2708_f
22         }
23  out:
24         if (buf)
25 -               dma_free_coherent(NULL, PAGE_ALIGN(size), buf, bus_addr);
26 +               dma_free_coherent(fb->fb.device, PAGE_ALIGN(size), buf, bus_addr);
27         return rc;
28  }
29