0546-fb-Use-struct-device-for-dma_alloc_coherent.patch 924 B

1234567891011121314151617181920212223242526272829
  1. From aeef7a1c42f363b30a5a4c48f12301a5b46d8427 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. drivers/video/fbdev/bcm2708_fb.c | 4 ++--
  7. 1 file changed, 2 insertions(+), 2 deletions(-)
  8. --- a/drivers/video/fbdev/bcm2708_fb.c
  9. +++ b/drivers/video/fbdev/bcm2708_fb.c
  10. @@ -507,7 +507,7 @@ static long vc_mem_copy(struct bcm2708_f
  11. return -EFAULT;
  12. }
  13. - buf = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &bus_addr,
  14. + buf = dma_alloc_coherent(fb->fb.device, PAGE_ALIGN(size), &bus_addr,
  15. GFP_ATOMIC);
  16. if (!buf) {
  17. pr_err("[%s]: failed to dma_alloc_coherent(%d)\n",
  18. @@ -531,7 +531,7 @@ static long vc_mem_copy(struct bcm2708_f
  19. }
  20. out:
  21. if (buf)
  22. - dma_free_coherent(NULL, PAGE_ALIGN(size), buf, bus_addr);
  23. + dma_free_coherent(fb->fb.device, PAGE_ALIGN(size), buf, bus_addr);
  24. return rc;
  25. }