0535-rpi-ft5406-Pass-device-structure-into-dma_zalloc_coh.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From caae57f942bb200e8bf32db60e124e7a2ce798e0 Mon Sep 17 00:00:00 2001
  2. From: popcornmix <popcornmix@gmail.com>
  3. Date: Mon, 14 Nov 2016 20:14:21 +0000
  4. Subject: [PATCH] rpi-ft5406: Pass device structure into dma_zalloc_coherent
  5. ---
  6. drivers/input/touchscreen/rpi-ft5406.c | 6 +++---
  7. 1 file changed, 3 insertions(+), 3 deletions(-)
  8. --- a/drivers/input/touchscreen/rpi-ft5406.c
  9. +++ b/drivers/input/touchscreen/rpi-ft5406.c
  10. @@ -151,7 +151,7 @@ static int ft5406_probe(struct platform_
  11. return -ENOMEM;
  12. }
  13. - ts->ts_base = dma_zalloc_coherent(NULL, PAGE_SIZE, &ts->bus_addr, GFP_KERNEL);
  14. + ts->ts_base = dma_zalloc_coherent(dev, PAGE_SIZE, &ts->bus_addr, GFP_KERNEL);
  15. if (!ts->ts_base) {
  16. pr_err("[%s]: failed to dma_alloc_coherent(%ld)\n",
  17. __func__, PAGE_SIZE);
  18. @@ -165,7 +165,7 @@ static int ft5406_probe(struct platform_
  19. if (err || touchbuf != 0) {
  20. dev_warn(dev, "Failed to set touchbuf, trying to get err:%x\n", err);
  21. - dma_free_coherent(NULL, PAGE_SIZE, ts->ts_base, ts->bus_addr);
  22. + dma_free_coherent(dev, PAGE_SIZE, ts->ts_base, ts->bus_addr);
  23. ts->ts_base = 0;
  24. ts->bus_addr = 0;
  25. }
  26. @@ -238,7 +238,7 @@ static int ft5406_probe(struct platform_
  27. out:
  28. if (ts->bus_addr) {
  29. - dma_free_coherent(NULL, PAGE_SIZE, ts->ts_base, ts->bus_addr);
  30. + dma_free_coherent(dev, PAGE_SIZE, ts->ts_base, ts->bus_addr);
  31. ts->bus_addr = 0;
  32. ts->ts_base = NULL;
  33. } else if (ts->ts_base) {