--- zzzz-none-000/linux-4.4.271/drivers/staging/android/ion/ion_chunk_heap.c 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/drivers/staging/android/ion/ion_chunk_heap.c 2023-01-11 09:25:42.000000000 +0000 @@ -99,14 +99,15 @@ struct scatterlist *sg; int i; unsigned long allocated_size; + struct device *dev = heap->priv; allocated_size = ALIGN(buffer->size, chunk_heap->chunk_size); ion_heap_buffer_zero(buffer); if (ion_buffer_cached(buffer)) - dma_sync_sg_for_device(NULL, table->sgl, table->nents, - DMA_BIDIRECTIONAL); + dma_sync_sg_for_device(dev, table->sgl, table->nents, + DMA_BIDIRECTIONAL); for_each_sg(table->sgl, sg, table->nents, i) { gen_pool_free(chunk_heap->pool, page_to_phys(sg_page(sg)), @@ -144,11 +145,12 @@ int ret; struct page *page; size_t size; + struct device *dev = heap_data->priv; page = pfn_to_page(PFN_DOWN(heap_data->base)); size = heap_data->size; - ion_pages_sync_for_device(NULL, page, size, DMA_BIDIRECTIONAL); + ion_pages_sync_for_device(dev, page, size, DMA_BIDIRECTIONAL); ret = ion_heap_pages_zero(page, size, pgprot_writecombine(PAGE_KERNEL)); if (ret) @@ -173,8 +175,8 @@ chunk_heap->heap.ops = &chunk_heap_ops; chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE; - pr_debug("%s: base %lu size %zu align %ld\n", __func__, - chunk_heap->base, heap_data->size, heap_data->align); + pr_debug("%s: base %pad size %zu align %pad\n", __func__, + &chunk_heap->base, heap_data->size, &heap_data->align); return &chunk_heap->heap;