jz4740_fb: fix DMA API abuse
authorChristoph Hellwig <hch@lst.de>
Fri, 21 Jun 2019 13:13:14 +0000 (15:13 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 21 Jun 2019 13:13:14 +0000 (15:13 +0200)
Virtual addresses return from dma(m)_alloc_coherent are opaque in what
backs then, and drivers must not poke into them.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
[b.zolnierkie: patch description fixup]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/jz4740_fb.c

index 145095655cc27b7244d8a600b9d4eca18b5d376a..1f78b2bfe566173442227f83efe307dcb0777ca5 100644 (file)
@@ -457,7 +457,6 @@ static int jzfb_alloc_devmem(struct jzfb *jzfb)
 {
        int max_videosize = 0;
        struct fb_videomode *mode = jzfb->pdata->modes;
-       void *page;
        int i;
 
        for (i = 0; i < jzfb->pdata->num_modes; ++mode, ++i) {
@@ -482,12 +481,6 @@ static int jzfb_alloc_devmem(struct jzfb *jzfb)
        if (!jzfb->vidmem)
                goto err_free_framedesc;
 
-       for (page = jzfb->vidmem;
-                page < jzfb->vidmem + PAGE_ALIGN(jzfb->vidmem_size);
-                page += PAGE_SIZE) {
-               SetPageReserved(virt_to_page(page));
-       }
-
        jzfb->framedesc->next = jzfb->framedesc_phys;
        jzfb->framedesc->addr = jzfb->vidmem_phys;
        jzfb->framedesc->id = 0xdeafbead;