ARM: SAMSUNG: Add setname core function for S3C24XX NAND
authorAtul Dahiya <atul.dahiya@samsung.com>
Mon, 18 Oct 2010 10:56:45 +0000 (19:56 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Mon, 18 Oct 2010 10:56:45 +0000 (19:56 +0900)
This patch replaces the device name assignment method from string assignment
to set_name method for all s3c24xx machines and adds device core file.

Signed-off-by: Atul Dahiya <atul.dahiya@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s3c2412/s3c2412.c
arch/arm/mach-s3c2416/s3c2416.c
arch/arm/mach-s3c2440/s3c244x.c
arch/arm/mach-s3c2443/s3c2443.c
arch/arm/plat-samsung/include/plat/nand-core.h [new file with mode: 0644]

index bef39f77729d360c8d08cd33ffc6b912c1d802d8..4c6df51ddf33fea00f57ef5b8e68741960a090af 100644 (file)
@@ -51,6 +51,7 @@
 #include <plat/clock.h>
 #include <plat/pm.h>
 #include <plat/pll.h>
+#include <plat/nand-core.h>
 
 #ifndef CONFIG_CPU_S3C2412_ONLY
 void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
@@ -92,7 +93,7 @@ void __init s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no)
        /* rename devices that are s3c2412/s3c2413 specific */
        s3c_device_sdi.name  = "s3c2412-sdi";
        s3c_device_lcd.name  = "s3c2412-lcd";
-       s3c_device_nand.name = "s3c2412-nand";
+       s3c_nand_setname("s3c2412-nand");
 
        /* alter IRQ of SDI controller */
 
index bc30245e133b0b5b31b4ff213f1d8953be17a881..620718939628839c3b3afe09d4a468d239239b67 100644 (file)
@@ -56,6 +56,7 @@
 
 #include <plat/iic-core.h>
 #include <plat/fb-core.h>
+#include <plat/nand-core.h>
 
 static struct map_desc s3c2416_iodesc[] __initdata = {
        IODESC_ENT(WATCHDOG),
@@ -100,7 +101,7 @@ void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
        s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
 
-       s3c_device_nand.name = "s3c2416-nand";
+       s3c_nand_setname("s3c2416-nand");
 }
 
 /* s3c2416_map_io
index 5e4a97e765334d1b696c17c77b301562f82334d6..90c1707b9c9546d0709a61ea6f49ac4e56f884fb 100644 (file)
@@ -44,6 +44,7 @@
 #include <plat/cpu.h>
 #include <plat/pm.h>
 #include <plat/pll.h>
+#include <plat/nand-core.h>
 
 static struct map_desc s3c244x_iodesc[] __initdata = {
        IODESC_ENT(CLKPWR),
@@ -68,7 +69,7 @@ void __init s3c244x_map_io(void)
 
        s3c_device_sdi.name  = "s3c2440-sdi";
        s3c_device_i2c0.name  = "s3c2440-i2c";
-       s3c_device_nand.name = "s3c2440-nand";
+       s3c_nand_setname("s3c2440-nand");
        s3c_device_ts.name = "s3c2440-ts";
        s3c_device_usbgadget.name = "s3c2440-usbgadget";
 }
index 839b6b2ced740b80acf6d751bc980ccfd745eee7..33d18dd1ebd5e061ffaffd1934daeb7fedb8aee7 100644 (file)
@@ -36,6 +36,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb-core.h>
+#include <plat/nand-core.h>
 
 static struct map_desc s3c2443_iodesc[] __initdata = {
        IODESC_ENT(WATCHDOG),
@@ -62,7 +63,7 @@ int __init s3c2443_init(void)
 
        s3c24xx_reset_hook = s3c2443_hard_reset;
 
-       s3c_device_nand.name = "s3c2412-nand";
+       s3c_nand_setname("s3c2412-nand");
        s3c_fb_setname("s3c2443-fb");
 
        /* change WDT IRQ number */
diff --git a/arch/arm/plat-samsung/include/plat/nand-core.h b/arch/arm/plat-samsung/include/plat/nand-core.h
new file mode 100644 (file)
index 0000000..6de2078
--- /dev/null
@@ -0,0 +1,28 @@
+/* arch/arm/plat-samsung/include/plat/nand-core.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S3C -  Nand Controller core functions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_NAND_CORE_H
+#define __ASM_ARCH_NAND_CORE_H __FILE__
+
+/* These functions are only for use with the core support code, such as
+ * the cpu specific initialisation code
+ */
+
+/* re-define device name depending on support. */
+static inline void s3c_nand_setname(char *name)
+{
+#ifdef CONFIG_S3C_DEV_NAND
+       s3c_device_nand.name = name;
+#endif
+}
+
+#endif /* __ASM_ARCH_NAND_CORE_H */