aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-omap.c
diff options
context:
space:
mode:
authorTarun Kanti DebBarma <tarun.kanti@ti.com>2012-07-11 05:13:14 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-07-17 15:00:17 -0400
commit346720130aa49e1b711c0900e98fd12f4de972b0 (patch)
treec4e033fd1d5abb14a6f5fc126f3e29d574854979 /drivers/gpio/gpio-omap.c
parentaeb27748e3bc1e89ec590713e574cb6f885cc3c6 (diff)
gpio/omap: move bank->dbck initialization to omap_gpio_mod_init()
Since the bank->dbck initialization in a one time operation there is no need to keep this within gpio_debounce(). Therefore, moving clk_get(bank->dbck) to omap_gpio_mod_init(). Since the value of bank->dbck would be NULL at the beginning, this check has been removed. Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com> Reported-by: Paul Walmsley <paul@pwsan.com> Reviewed-by: Jon Hunter <jon-hunter@ti.com> Cc: Kevin Hilman <khilman@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Cousson, Benoit <b-cousson@ti.com> Reviewed-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-omap.c')
-rw-r--r--drivers/gpio/gpio-omap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed1722734c..afecdccfc66e 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -889,12 +889,6 @@ static int gpio_debounce(struct gpio_chip *chip, unsigned offset,
889 889
890 bank = container_of(chip, struct gpio_bank, chip); 890 bank = container_of(chip, struct gpio_bank, chip);
891 891
892 if (!bank->dbck) {
893 bank->dbck = clk_get(bank->dev, "dbclk");
894 if (IS_ERR(bank->dbck))
895 dev_err(bank->dev, "Could not get gpio dbck\n");
896 }
897
898 spin_lock_irqsave(&bank->lock, flags); 892 spin_lock_irqsave(&bank->lock, flags);
899 _set_gpio_debounce(bank, offset, debounce); 893 _set_gpio_debounce(bank, offset, debounce);
900 spin_unlock_irqrestore(&bank->lock, flags); 894 spin_unlock_irqrestore(&bank->lock, flags);
@@ -966,6 +960,10 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
966 /* Initialize interface clk ungated, module enabled */ 960 /* Initialize interface clk ungated, module enabled */
967 if (bank->regs->ctrl) 961 if (bank->regs->ctrl)
968 __raw_writel(0, base + bank->regs->ctrl); 962 __raw_writel(0, base + bank->regs->ctrl);
963
964 bank->dbck = clk_get(bank->dev, "dbclk");
965 if (IS_ERR(bank->dbck))
966 dev_err(bank->dev, "Could not get gpio dbck\n");
969} 967}
970 968
971static __devinit void 969static __devinit void