s5j/gpio: do not place s5jt200_gpio_bank[] on a special section
authorHeesub Shin <heesub.shin@samsung.com>
Sat, 11 Mar 2017 08:21:13 +0000 (17:21 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:00:56 +0000 (19:00 +0900)
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 <heesub.shin@samsung.com>
os/arch/arm/src/s5j/s5j_gpio.c
os/arch/arm/src/s5j/s5j_gpio.h

index ade60fc..11ba48b 100644 (file)
@@ -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;
        }
 
index 71323ac..8d9562a 100644 (file)
@@ -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)