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

From: FUJITA Tomonori
Date: Mon Sep 27 2010 - 20:12:30 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/