Skip to content

Commit

Permalink
ARM: SAMSUNG: Add setname core function for S3C24XX NAND
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Atul Dahiya authored and Kukjin Kim committed Oct 18, 2010
1 parent 66ad4ee commit ef3f2dd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
3 changes: 2 additions & 1 deletion arch/arm/mach-s3c2412/s3c2412.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */

Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-s3c2416/s3c2416.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-s3c2440/s3c244x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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";
}
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-s3c2443/s3c2443.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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 */
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/plat-samsung/include/plat/nand-core.h
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit ef3f2dd

Please sign in to comment.