MIPS: Alchemy: Remove direct access to prepare_count field of struct clk
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Mon, 20 Oct 2014 13:40:01 +0000 (15:40 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:17 +0000 (07:45 +0100)
Replacing it with a call to __clk_is_prepared(), which isn't entirely
equivalent but in practice shouldn't matter.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8120/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/alchemy/common/clock.c

index d7557cde271aa7e9468af3213be0a15da9277151..203e4403c366869ed1acbd99cbf4e82c92b83942 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/io.h>
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
-#include <linux/clk-private.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
@@ -397,10 +396,10 @@ static long alchemy_clk_fgcs_detr(struct clk_hw *hw, unsigned long rate,
                        break;
 
                /* if this parent is currently unused, remember it.
-                * XXX: I know it's a layering violation, but it works
-                * so well.. (if (!clk_has_active_children(pc)) )
+                * XXX: we would actually want clk_has_active_children()
+                * but this is a good-enough approximation for now.
                 */
-               if (pc->prepare_count == 0) {
+               if (!__clk_is_prepared(pc)) {
                        if (!free)
                                free = pc;
                }