[1/2] gpio/omap: move bank->dbck initialization to omap_gpio_mod_init()
diff mbox

Message ID 1341997995-14020-2-git-send-email-tarun.kanti@ti.com
State New, archived
Headers show

Commit Message

Tarun Kanti DebBarma July 11, 2012, 9:13 a.m. UTC
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>
Cc: Paul Walmsley <paul@pwsan.com>
---
 drivers/gpio/gpio-omap.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

Comments

Paul Walmsley July 11, 2012, 5:51 p.m. UTC | #1
On Wed, 11 Jul 2012, Tarun Kanti DebBarma wrote:

> 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>
> Cc: Paul Walmsley <paul@pwsan.com>
> ---
>  drivers/gpio/gpio-omap.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)

Reviewed-by: Paul Walmsley <paul@pwsan.com>

These drivers are maintained by Grant Likely and Linus Walleij:

GPIO SUBSYSTEM
M:      Grant Likely <grant.likely@secretlab.ca>
M:      Linus Walleij <linus.walleij@stericsson.com>
S:      Maintained
T:      git git://git.secretlab.ca/git/linux-2.6.git
F:      Documentation/gpio.txt
F:      drivers/gpio/
F:      include/linux/gpio*

So you'll want to cc them.  They are probably also who should merge these.


- Paul
Tarun Kanti DebBarma July 11, 2012, 5:56 p.m. UTC | #2
On Wed, Jul 11, 2012 at 11:21 PM, Paul Walmsley <paul@pwsan.com> wrote:
> On Wed, 11 Jul 2012, Tarun Kanti DebBarma wrote:
>
>> 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>
>> Cc: Paul Walmsley <paul@pwsan.com>
>> ---
>>  drivers/gpio/gpio-omap.c |   10 ++++------
>>  1 files changed, 4 insertions(+), 6 deletions(-)
>
> Reviewed-by: Paul Walmsley <paul@pwsan.com>
>
> These drivers are maintained by Grant Likely and Linus Walleij:
>
> GPIO SUBSYSTEM
> M:      Grant Likely <grant.likely@secretlab.ca>
> M:      Linus Walleij <linus.walleij@stericsson.com>
> S:      Maintained
> T:      git git://git.secretlab.ca/git/linux-2.6.git
> F:      Documentation/gpio.txt
> F:      drivers/gpio/
> F:      include/linux/gpio*
>
> So you'll want to cc them.  They are probably also who should merge these.
Ok, I wanted Kevin to have a look first. Anyways, I have cc'ed.
Thanks.
--
Tarun
>
>
> - Paul
Linus Walleij July 11, 2012, 9:51 p.m. UTC | #3
On Wed, Jul 11, 2012 at 11:13 AM, Tarun Kanti DebBarma
<tarun.kanti@ti.com> wrote:

> 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>

Applied with Pauld reviewed-by.

Thanks,
Linus Walleij

Patch
diff mbox

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index c4ed172..afecdcc 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,
 
 	bank = container_of(chip, struct gpio_bank, chip);
 
-	if (!bank->dbck) {
-		bank->dbck = clk_get(bank->dev, "dbclk");
-		if (IS_ERR(bank->dbck))
-			dev_err(bank->dev, "Could not get gpio dbck\n");
-	}
-
 	spin_lock_irqsave(&bank->lock, flags);
 	_set_gpio_debounce(bank, offset, debounce);
 	spin_unlock_irqrestore(&bank->lock, flags);
@@ -966,6 +960,10 @@  static void omap_gpio_mod_init(struct gpio_bank *bank)
 	 /* Initialize interface clk ungated, module enabled */
 	if (bank->regs->ctrl)
 		__raw_writel(0, base + bank->regs->ctrl);
+
+	bank->dbck = clk_get(bank->dev, "dbclk");
+	if (IS_ERR(bank->dbck))
+		dev_err(bank->dev, "Could not get gpio dbck\n");
 }
 
 static __devinit void