diff options
author | Charulatha V <charu@ti.com> | 2011-04-22 16:38:16 +0530 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2011-07-14 11:53:13 -0700 |
commit | b1a3c3601b100db1bf90094c786a1e868c9b258f (patch) | |
tree | 7ce6dba8cd988a0487aa57cd0e4b34ab7310c457 /drivers/gpio | |
parent | 7aea3b477e775398cdcf1ece6b0179f64ea3b740 (diff) | |
download | kernel_samsung_tuna-b1a3c3601b100db1bf90094c786a1e868c9b258f.zip kernel_samsung_tuna-b1a3c3601b100db1bf90094c786a1e868c9b258f.tar.gz kernel_samsung_tuna-b1a3c3601b100db1bf90094c786a1e868c9b258f.tar.bz2 |
GPIO: OMAP: remove get_gpio_bank()
use chip info to get the pointer to the struct gpio_bank for a
given GPIO bank and remove get_gpio_bank().
Signed-off-by: Charulatha V <charu@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 8246db6..9f2bdb6 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -88,31 +88,6 @@ int gpio_bank_count; #define GPIO_INDEX(bank, gpio) (gpio % bank->width) #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio)) -static inline struct gpio_bank *get_gpio_bank(int gpio) -{ - if (cpu_is_omap15xx()) { - if (OMAP_GPIO_IS_MPUIO(gpio)) - return &gpio_bank[0]; - return &gpio_bank[1]; - } - if (cpu_is_omap16xx()) { - if (OMAP_GPIO_IS_MPUIO(gpio)) - return &gpio_bank[0]; - return &gpio_bank[1 + (gpio >> 4)]; - } - if (cpu_is_omap7xx()) { - if (OMAP_GPIO_IS_MPUIO(gpio)) - return &gpio_bank[0]; - return &gpio_bank[1 + (gpio >> 5)]; - } - if (cpu_is_omap24xx()) - return &gpio_bank[gpio >> 5]; - if (cpu_is_omap34xx() || cpu_is_omap44xx()) - return &gpio_bank[gpio >> 5]; - BUG(); - return NULL; -} - static inline int gpio_valid(int gpio) { if (gpio < 0) @@ -1269,7 +1244,7 @@ static struct platform_device omap_mpuio_device = { static inline void mpuio_init(void) { - struct gpio_bank *bank = get_gpio_bank(OMAP_MPUIO(0)); + struct gpio_bank *bank = &gpio_bank[0]; platform_set_drvdata(&omap_mpuio_device, bank); if (platform_driver_register(&omap_mpuio_driver) == 0) @@ -1345,7 +1320,7 @@ static int gpio_get(struct gpio_chip *chip, unsigned offset) u32 mask; gpio = chip->base + offset; - bank = get_gpio_bank(gpio); + bank = container_of(chip, struct gpio_bank, chip); reg = bank->base; mask = GPIO_BIT(bank, gpio); |