From 5704c1224199884e5e91d993c1c77d5938b6d5c9 Mon Sep 17 00:00:00 2001 From: Heesub Shin Date: Sat, 11 Mar 2017 17:21:13 +0900 Subject: [PATCH] s5j/gpio: do not place s5jt200_gpio_bank[] on a special section There is no point in putting the array s5jt200_gpio_bank[] into a special section for it. Though I do not know any historic background, it looks very redundant, dirty and inconsistent. Not only that, this makes us to define some variables in linker script in all target boards that are based on S5J platform. This is very annoying and has no benefit to do so. Change-Id: Idd41b1944491fbf0c3d158a2cfeec7fbd8c094ca Signed-off-by: Heesub Shin --- os/arch/arm/src/s5j/s5j_gpio.c | 9 +++------ os/arch/arm/src/s5j/s5j_gpio.h | 3 --- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/os/arch/arm/src/s5j/s5j_gpio.c b/os/arch/arm/src/s5j/s5j_gpio.c index ade60fc..11ba48b 100644 --- a/os/arch/arm/src/s5j/s5j_gpio.c +++ b/os/arch/arm/src/s5j/s5j_gpio.c @@ -110,7 +110,7 @@ static struct gpio_dev_s s5j_gpio_all[NUM_GPIO]; * Public Data ****************************************************************************/ #if defined(CONFIG_ARCH_CHIP_S5JT200) -GPIO_BANK(s5jt200) = { +static struct gpio_bank s5jt200_gpio_bank[] = { /* ALIVE */ [GPP0] = { .name = "GPP0", @@ -213,9 +213,6 @@ GPIO_BANK(s5jt200) = { }; #endif -extern struct gpio_bank gpio_bank_start; -extern struct gpio_bank gpio_bank_end; -struct gpio_bank *mach_gpio_bank = &gpio_bank_start; #if defined(CONFIG_S5E_GPIO_LOG_DUMP) static char *pull_str[] = { "none", "?", "down", "up" }; static char *drv_str[] = { "1x", "3x", "2x", "4x" }; @@ -272,7 +269,7 @@ static struct gpio_bank *gpio_to_bank(int gpio) return NULL; } - return mach_gpio_bank + bank; + return s5jt200_gpio_bank + bank; } static void *__gpio_to_eint_base(int gpio) @@ -488,7 +485,7 @@ int gpio_valid(int gpio) return 0; } - if (port >= mach_gpio_bank[bank].nr_port) { + if (port >= s5jt200_gpio_bank[bank].nr_port) { return 0; } diff --git a/os/arch/arm/src/s5j/s5j_gpio.h b/os/arch/arm/src/s5j/s5j_gpio.h index 71323ac..8d9562a 100644 --- a/os/arch/arm/src/s5j/s5j_gpio.h +++ b/os/arch/arm/src/s5j/s5j_gpio.h @@ -159,9 +159,6 @@ struct gpio_bank { int filter_offset_addr; }; -#define GPIO_BANK(name) \ - static struct gpio_bank name##_gpio_bank[] __attribute__((used, aligned(4), section(".gpio_bank."#name))) - #define irq_id_to_gpio(irq_id) (GPIO_MAGIC | (irq_id >> 16)) #define gpio_irq_id(gpio, isr_num) ((gpio & 0xFFFF) << 16 | isr_num) -- 2.7.4