Skip to content

Commit

Permalink
ARM: orion: Rename some constants to macros to make code more identical
Browse files Browse the repository at this point in the history
Changing eg 0xffffffff to DMA_BIT_MASK(32) etc allows easier
side by side comparision of identical code which can be consolidated.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
  • Loading branch information
Andrew Lunn authored and Nicolas Pitre committed May 16, 2011
1 parent e59347a commit 5c60255
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 62 deletions.
7 changes: 4 additions & 3 deletions arch/arm/mach-dove/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/mv643xx_eth.h>
#include <linux/mv643xx_i2c.h>
#include <linux/ata_platform.h>
#include <linux/serial_8250.h>
#include <linux/spi/orion_spi.h>
#include <linux/gpio.h>
#include <asm/page.h>
Expand Down Expand Up @@ -281,7 +282,7 @@ static struct resource dove_uart0_resources[] = {

static struct platform_device dove_uart0 = {
.name = "serial8250",
.id = 0,
.id = PLAT8250_DEV_PLATFORM,
.dev = {
.platform_data = dove_uart0_data,
},
Expand Down Expand Up @@ -324,7 +325,7 @@ static struct resource dove_uart1_resources[] = {

static struct platform_device dove_uart1 = {
.name = "serial8250",
.id = 1,
.id = PLAT8250_DEV_PLATFORM1,
.dev = {
.platform_data = dove_uart1_data,
},
Expand Down Expand Up @@ -367,7 +368,7 @@ static struct resource dove_uart2_resources[] = {

static struct platform_device dove_uart2 = {
.name = "serial8250",
.id = 2,
.id = PLAT8250_DEV_PLATFORM2,
.dev = {
.platform_data = dove_uart2_data,
},
Expand Down
28 changes: 14 additions & 14 deletions arch/arm/mach-kirkwood/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static struct orion_ehci_data kirkwood_ehci_data = {
.phy_version = EHCI_PHY_NA,
};

static u64 ehci_dmamask = 0xffffffffUL;
static u64 ehci_dmamask = DMA_BIT_MASK(32);


/*****************************************************************************
Expand All @@ -88,7 +88,7 @@ static u64 ehci_dmamask = 0xffffffffUL;
static struct resource kirkwood_ehci_resources[] = {
{
.start = USB_PHYS_BASE,
.end = USB_PHYS_BASE + 0x0fff,
.end = USB_PHYS_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_KIRKWOOD_USB,
Expand All @@ -102,7 +102,7 @@ static struct platform_device kirkwood_ehci = {
.id = 0,
.dev = {
.dma_mask = &ehci_dmamask,
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &kirkwood_ehci_data,
},
.resource = kirkwood_ehci_resources,
Expand All @@ -127,7 +127,7 @@ static struct resource kirkwood_ge00_shared_resources[] = {
{
.name = "ge00 base",
.start = GE00_PHYS_BASE + 0x2000,
.end = GE00_PHYS_BASE + 0x3fff,
.end = GE00_PHYS_BASE + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "ge00 err irq",
Expand Down Expand Up @@ -162,7 +162,7 @@ static struct platform_device kirkwood_ge00 = {
.num_resources = 1,
.resource = kirkwood_ge00_resources,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};

Expand All @@ -189,7 +189,7 @@ static struct resource kirkwood_ge01_shared_resources[] = {
{
.name = "ge01 base",
.start = GE01_PHYS_BASE + 0x2000,
.end = GE01_PHYS_BASE + 0x3fff,
.end = GE01_PHYS_BASE + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.name = "ge01 err irq",
Expand Down Expand Up @@ -224,7 +224,7 @@ static struct platform_device kirkwood_ge01 = {
.num_resources = 1,
.resource = kirkwood_ge01_resources,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};

Expand Down Expand Up @@ -358,7 +358,7 @@ static struct platform_device kirkwood_sata = {
.name = "sata_mv",
.id = 0,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(kirkwood_sata_resources),
.resource = kirkwood_sata_resources,
Expand Down Expand Up @@ -391,14 +391,14 @@ static struct resource mvsdio_resources[] = {
},
};

static u64 mvsdio_dmamask = 0xffffffffUL;
static u64 mvsdio_dmamask = DMA_BIT_MASK(32);

static struct platform_device kirkwood_sdio = {
.name = "mvsdio",
.id = -1,
.dev = {
.dma_mask = &mvsdio_dmamask,
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(mvsdio_resources),
.resource = mvsdio_resources,
Expand Down Expand Up @@ -518,7 +518,7 @@ static struct resource kirkwood_uart0_resources[] = {

static struct platform_device kirkwood_uart0 = {
.name = "serial8250",
.id = 0,
.id = PLAT8250_DEV_PLATFORM,
.dev = {
.platform_data = kirkwood_uart0_data,
},
Expand Down Expand Up @@ -562,7 +562,7 @@ static struct resource kirkwood_uart1_resources[] = {

static struct platform_device kirkwood_uart1 = {
.name = "serial8250",
.id = 1,
.id = PLAT8250_DEV_PLATFORM1,
.dev = {
.platform_data = kirkwood_uart1_data,
},
Expand Down Expand Up @@ -620,8 +620,6 @@ static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = {
.dram = &kirkwood_mbus_dram_info,
};

static u64 kirkwood_xor_dmamask = DMA_BIT_MASK(32);


/*****************************************************************************
* XOR0
Expand Down Expand Up @@ -650,6 +648,8 @@ static struct platform_device kirkwood_xor0_shared = {
.resource = kirkwood_xor0_shared_resources,
};

static u64 kirkwood_xor_dmamask = DMA_BIT_MASK(32);

static struct resource kirkwood_xor00_resources[] = {
[0] = {
.start = IRQ_KIRKWOOD_XOR_00,
Expand Down
15 changes: 8 additions & 7 deletions arch/arm/mach-loki/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/serial_8250.h>
#include <linux/mbus.h>
#include <linux/mv643xx_eth.h>
#include <linux/dma-mapping.h>
#include <asm/page.h>
#include <asm/timex.h>
#include <asm/mach/map.h>
Expand Down Expand Up @@ -54,7 +55,7 @@ static struct resource loki_ge0_shared_resources[] = {
{
.name = "ge0 base",
.start = GE0_PHYS_BASE + 0x2000,
.end = GE0_PHYS_BASE + 0x3fff,
.end = GE0_PHYS_BASE + SZ_16K - 1,
.flags = IORESOURCE_MEM,
},
};
Expand Down Expand Up @@ -84,7 +85,7 @@ static struct platform_device loki_ge0 = {
.num_resources = 1,
.resource = loki_ge0_resources,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};

Expand All @@ -111,7 +112,7 @@ static struct resource loki_ge1_shared_resources[] = {
{
.name = "ge1 base",
.start = GE1_PHYS_BASE + 0x2000,
.end = GE1_PHYS_BASE + 0x3fff,
.end = GE1_PHYS_BASE + SZ_16K - 1,
.flags = IORESOURCE_MEM,
},
};
Expand Down Expand Up @@ -141,7 +142,7 @@ static struct platform_device loki_ge1 = {
.num_resources = 1,
.resource = loki_ge1_resources,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};

Expand Down Expand Up @@ -187,7 +188,7 @@ static struct platform_device loki_sas = {
.name = "mvsas",
.id = 0,
.dev = {
.coherent_dma_mask = 0xffffffff,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
.num_resources = ARRAY_SIZE(loki_sas_resources),
.resource = loki_sas_resources,
Expand Down Expand Up @@ -230,7 +231,7 @@ static struct resource loki_uart0_resources[] = {

static struct platform_device loki_uart0 = {
.name = "serial8250",
.id = 0,
.id = PLAT8250_DEV_PLATFORM,
.dev = {
.platform_data = loki_uart0_data,
},
Expand Down Expand Up @@ -274,7 +275,7 @@ static struct resource loki_uart1_resources[] = {

static struct platform_device loki_uart1 = {
.name = "serial8250",
.id = 1,
.id = PLAT8250_DEV_PLATFORM1,
.dev = {
.platform_data = loki_uart1_data,
},
Expand Down
Loading

0 comments on commit 5c60255

Please sign in to comment.