On Tue, Apr 04, 2017 at 12:23:19PM +0530, Mahesh Rajashekhara wrote: > +#if defined(CONFIG_ARM64) > +static inline void * > +aac_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, > + dma_addr_t *dma_handle) { > + return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, > + size, > + dma_handle, > + GFP_KERNEL); > +} > +#else > +static inline void * > +aac_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, > + dma_addr_t *dma_handle) { > + return pci_alloc_consistent(hwdev, size, dma_handle); > +} > +#endif Please just call the dma_*_coherent routines directly all the time. hwdev should never be NULL, so that workaround can be dropped as well. And while you're at it please remove all the casts to and from void * in the arguments and return values.