On Tue, Jan 03, 2012 at 07:34:48PM +0100, Nicolas Ferre wrote:
> +     at91_gpio->clock = clk_get_sys(NULL, at91_gpio->chip.label);
> +     if (!at91_gpio->clock) {
> +             pr_err("at91_gpio.%d, failed to get clock, ignoring.\n",
> +                                                             alias_id);
> +             goto ioremap_err;
> +     }
> +
> +     /* enable PIO controller's clock */
> +     if(clk_enable(at91_gpio->clock)) {
> +             pr_err("at91_gpio.%d, failed to enable clock, ignoring.\n",
> +                                                             alias_id);
> +             goto clk_err;
> +     }

No new code should be added to the kernel which uses clk_enable() without
using clk_prepare() first.  Ditto clk_disable() and clk_unprepare().

> +     at91_gpio->clock = clk_get_sys(NULL, at91_gpio->chip.label);
> +     if (!at91_gpio->clock) {
> +             pr_err("at91_gpio.%d, failed to get clock, ignoring.\n", i);
> +             goto ioremap_err;
> +     }
> +
> +     if(clk_enable(at91_gpio->clock)) {
> +             pr_err("at91_gpio.%d, failed to enable clock, ignoring.\n", i);
> +             goto clk_err;
> +     }

I've seen this code somewhere before...  Couldn't this be separated out into
a helper function?
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to