From f928efa818adfe56a08350569a9b0f3c2fb791d2 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 19 Jul 2011 09:58:32 +0200 Subject: add a add_mem_device function Add a helper function for boards to register their memory devices. This makes the board code smaller and also helps getting rid of map_base and struct memory_platform_data. And switch all of the memory to it Signed-off-by: Sascha Hauer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/arm/mach-versatile/core.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'arch/arm/mach-versatile') diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 5857d43510..63cf4a5003 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -42,23 +42,13 @@ #include #include -static struct memory_platform_data ram_pdata = { - .name = "ram0", - .flags = IORESOURCE_MEM_WRITEABLE, -}; - -static struct device_d sdram_dev = { - .id = -1, - .name = "mem", - .map_base = 0x00000000, - .platform_data = &ram_pdata, -}; - void versatile_add_sdram(u32 size) { - sdram_dev.size = size; - register_device(&sdram_dev); - armlinux_add_dram(&sdram_dev); + struct device_d *sdram_dev; + + sdram_dev = add_mem_device("ram0", 0x00000000, size, + IORESOURCE_MEM_WRITEABLE); + armlinux_add_dram(sdram_dev); } static struct device_d uart0_serial_device = { -- cgit v1.2.3