Thread (1 message) 1 message, 1 author, 2012-01-04

Re: [PATCH v2 3/6] ARM: at91/gpio: add DT support

From: Russell King - ARM Linux <hidden>
Date: 2012-01-04 22:04:32
Also in: linux-arm-kernel

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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help