Re: [PATCH 5/9] MIPS: Convert DMA to use dma-mapping-common.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 Sep 2010 10:35:15 -0700
David Daney <ddaney@xxxxxxxxxxxxxxxxxx> wrote:

> >> diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
> >> index 18fbf7a..9a4c307 100644
> >> --- a/arch/mips/include/asm/dma-mapping.h
> >> +++ b/arch/mips/include/asm/dma-mapping.h
> >> @@ -5,51 +5,67 @@
> >>   #include<asm/cache.h>
> >>   #include<asm-generic/dma-coherent.h>
> >>
> >> -void *dma_alloc_noncoherent(struct device *dev, size_t size,
> >> -			   dma_addr_t *dma_handle, gfp_t flag);
> >> +struct mips_dma_map_ops {
> >> +	struct dma_map_ops dma_map_ops;
> >> +	dma_addr_t (*phys_to_dma)(struct device *dev, phys_addr_t paddr);
> >> +	phys_addr_t (*dma_to_phys)(struct device *dev, dma_addr_t daddr);
> >> +};
> >
> > The above code doesn't look great but we don't want to add phys_to_dma
> > and dma_to_phys to dma_map_ops struct, and these functions on MIPS
> > looks too complicated for ifdef. So I guess that we need to live with
> > the above code.
> >
> 
> I think you have a point here.  I will attempt to move these two into a 
> chip specific operations vector, and leave the more generic MIPS version 
> with the simplified static definition.

Yeah, that sounds a better (cleaner) approach.



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux