2012-06-19 21:38:52

by Linus Walleij

[permalink] [raw]
Subject: [PATCH] pinctrl/coh901: use clk_prepare_enable()

From: Linus Walleij <[email protected]>

The COH901 GPIO driver did not prepare its clock, so let us
fix it to do so.

Signed-off-by: Linus Walleij <[email protected]>
---
drivers/pinctrl/pinctrl-coh901.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index 55697a5..1b5d232a 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -770,7 +770,7 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
dev_err(gpio->dev, "could not get GPIO clock\n");
goto err_no_clk;
}
- err = clk_enable(gpio->clk);
+ err = clk_prepare_enable(gpio->clk);
if (err) {
dev_err(gpio->dev, "could not enable GPIO clock\n");
goto err_no_clk_enable;
--
1.7.9.2


2012-06-20 03:44:01

by Pankaj Jangra

[permalink] [raw]
Subject: Re: [PATCH] pinctrl/coh901: use clk_prepare_enable()

On Wed, Jun 20, 2012 at 3:08 AM, Linus Walleij
<[email protected]> wrote:
> From: Linus Walleij <[email protected]>
>
> The COH901 GPIO driver did not prepare its clock, so let us
> fix it to do so.
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> ?drivers/pinctrl/pinctrl-coh901.c | ? ?2 +-
> ?1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
> index 55697a5..1b5d232a 100644
> --- a/drivers/pinctrl/pinctrl-coh901.c
> +++ b/drivers/pinctrl/pinctrl-coh901.c
> @@ -770,7 +770,7 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
> ? ? ? ? ? ? ? ?dev_err(gpio->dev, "could not get GPIO clock\n");
> ? ? ? ? ? ? ? ?goto err_no_clk;
> ? ? ? ?}
> - ? ? ? err = clk_enable(gpio->clk);
> + ? ? ? err = clk_prepare_enable(gpio->clk);
> ? ? ? ?if (err) {
> ? ? ? ? ? ? ? ?dev_err(gpio->dev, "could not enable GPIO clock\n");
> ? ? ? ? ? ? ? ?goto err_no_clk_enable;

What about clk_disable_unprepare() in error path?

Regards,
Pankaj Jangra