diff mbox

[1/2] pinctrl: at91: fix clk_unprepare and clk_disable order

Message ID 1387132252-2584-2-git-send-email-b.brezillon@overkiz.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris BREZILLON Dec. 15, 2013, 6:30 p.m. UTC
clk_unprepare shall be called before clk_disable.
Fix the issue by replacing the clk_unprepare and clk_disable calls by a
single clk_disable_unprepare call.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/pinctrl/pinctrl-at91.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Nicolas Ferre Dec. 16, 2013, 9:56 a.m. UTC | #1
On 15/12/2013 19:30, Boris BREZILLON :
> clk_unprepare shall be called before clk_disable.
> Fix the issue by replacing the clk_unprepare and clk_disable calls by a
> single clk_disable_unprepare call.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks.

> ---
>  drivers/pinctrl/pinctrl-at91.c |    8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index a7549c4..82f6301 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1339,13 +1339,11 @@ void at91_pinctrl_gpio_suspend(void)
>  		__raw_writel(backups[i], pio + PIO_IDR);
>  		__raw_writel(wakeups[i], pio + PIO_IER);
>  
> -		if (!wakeups[i]) {
> -			clk_unprepare(gpio_chips[i]->clock);
> -			clk_disable(gpio_chips[i]->clock);
> -		} else {
> +		if (!wakeups[i])
> +			clk_disable_unprepare(gpio_chips[i]->clock);
> +		else
>  			printk(KERN_DEBUG "GPIO-%c may wake for %08x\n",
>  			       'A'+i, wakeups[i]);
> -		}
>  	}
>  }
>  
>
Linus Walleij Dec. 16, 2013, 1:22 p.m. UTC | #2
On Sun, Dec 15, 2013 at 7:30 PM, Boris BREZILLON
<b.brezillon@overkiz.com> wrote:

> clk_unprepare shall be called before clk_disable.
> Fix the issue by replacing the clk_unprepare and clk_disable calls by a
> single clk_disable_unprepare call.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Patch applied with Nicolas' ACK.

Yours,
Linus Walleij
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index a7549c4..82f6301 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1339,13 +1339,11 @@  void at91_pinctrl_gpio_suspend(void)
 		__raw_writel(backups[i], pio + PIO_IDR);
 		__raw_writel(wakeups[i], pio + PIO_IER);
 
-		if (!wakeups[i]) {
-			clk_unprepare(gpio_chips[i]->clock);
-			clk_disable(gpio_chips[i]->clock);
-		} else {
+		if (!wakeups[i])
+			clk_disable_unprepare(gpio_chips[i]->clock);
+		else
 			printk(KERN_DEBUG "GPIO-%c may wake for %08x\n",
 			       'A'+i, wakeups[i]);
-		}
 	}
 }