diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-02-27 20:31:51 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2015-12-01 21:50:24 +0100 |
commit | a0e157afd0c3ecb2e953eb41da04da2bf0e3d6c3 (patch) | |
tree | 7e6b92d70621cfd3771753012a0905da0c1051d7 /arch/arm/plat-samsung | |
parent | 0f20e456bd0542b7bf8cae8f553142405a8ab430 (diff) | |
download | linux-a0e157afd0c3ecb2e953eb41da04da2bf0e3d6c3.tar.bz2 |
ARM: s3c64xx: prepare initcalls for multiplatform
In a multiplatform kernel, each initcall is run regardless
of the platform it is meant for, so it must not attempt to
access SoC-specific registers.
This adds 'if (soc_is_s3c64xx)' to all initcalls that are
specific to the s3c64xx platform, to prevent them from breaking
other platforms once we can build them into a combined kernel.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Diffstat (limited to 'arch/arm/plat-samsung')
-rw-r--r-- | arch/arm/plat-samsung/gpio-samsung.c | 11 | ||||
-rw-r--r-- | arch/arm/plat-samsung/init.c | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/plat-samsung/gpio-samsung.c b/arch/arm/plat-samsung/gpio-samsung.c index 7c288ba4dc87..37faa8eab78f 100644 --- a/arch/arm/plat-samsung/gpio-samsung.c +++ b/arch/arm/plat-samsung/gpio-samsung.c @@ -1176,14 +1176,16 @@ static __init int samsung_gpiolib_init(void) * interfaces. For legacy (non-DT) platforms this driver is used. */ if (of_have_populated_dt()) - return -ENODEV; - - samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); + return 0; if (soc_is_s3c24xx()) { + samsung_gpiolib_set_cfg(samsung_gpio_cfgs, + ARRAY_SIZE(samsung_gpio_cfgs)); s3c24xx_gpiolib_add_chips(s3c24xx_gpios, ARRAY_SIZE(s3c24xx_gpios), S3C24XX_VA_GPIO); } else if (soc_is_s3c64xx()) { + samsung_gpiolib_set_cfg(samsung_gpio_cfgs, + ARRAY_SIZE(samsung_gpio_cfgs)); samsung_gpiolib_add_2bit_chips(s3c64xx_gpios_2bit, ARRAY_SIZE(s3c64xx_gpios_2bit), S3C64XX_VA_GPIO + 0xE0, 0x20); @@ -1192,9 +1194,6 @@ static __init int samsung_gpiolib_init(void) S3C64XX_VA_GPIO); samsung_gpiolib_add_4bit2_chips(s3c64xx_gpios_4bit2, ARRAY_SIZE(s3c64xx_gpios_4bit2)); - } else { - WARN(1, "Unknown SoC in gpio-samsung, no GPIOs added\n"); - return -ENODEV; } return 0; diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c index 11fbbc26e49f..3776f7e752f0 100644 --- a/arch/arm/plat-samsung/init.c +++ b/arch/arm/plat-samsung/init.c @@ -152,6 +152,11 @@ static int __init s3c_arch_init(void) { int ret; + /* init is only needed for ATAGS based platforms */ + if (!IS_ENABLED(CONFIG_ATAGS) || + (!soc_is_s3c24xx() && !soc_is_s3c64xx())) + return 0; + // do the correct init for cpu if (cpu == NULL) { |