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/x86/boards/x86_generic/generic_pc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'arch/x86/boards') diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c index efd081d436..fa2975f016 100644 --- a/arch/x86/boards/x86_generic/generic_pc.c +++ b/arch/x86/boards/x86_generic/generic_pc.c @@ -30,19 +30,6 @@ #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", - .size = 16 * 1024 * 1024, - .map_base = 0, - .platform_data = &ram_pdata, -}; - static struct device_d bios_disk_dev = { .id = -1, .name = "biosdrive", @@ -70,7 +57,8 @@ static int devices_init(void) sdram_dev.size = bios_get_memsize(); /* extended memory only */ sdram_dev.size <<= 10; - register_device(&sdram_dev); + add_mem_device("ram0", 0x0, 16 * 1024 * 1024, + IORESOURCE_MEM_WRITEABLE); register_device(&bios_disk_dev); if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) { -- cgit v1.2.3