[PATCH v2 02/23] at91: Make Ethernet device common

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Apr 28 05:15:17 EDT 2011


On Thu, Apr 21, 2011 at 06:19:37PM -0500, H Hartley Sweeten wrote:
> +static struct platform_device at91_eth_device = {
> +	.name		= "macb",
> +	.id		= -1,
> +	.dev		= {
> +		.dma_mask		= &at91_eth_device.dev.coherent_dma_mask,
> +		.coherent_dma_mask	= DMA_BIT_MASK(32),
> 
> That will get rid of the static u64 variable used for every dma
> capable device.

I've never really liked that, because coherent_dma_mask is never changed,
but the value pointed to be dma_mask can be by drivers.  See dma_set_mask().

So, calling dma_set_mask() on any device which does the above will also
(unexpectedly?) change the coherent mask too.

It's a minor point as we don't have many platform drivers using
dma_set_mask().



More information about the linux-arm-kernel mailing list