sh: clock framework update, fix count and kill off kref

This patch updates the clock framework use count code.
With this patch the enable() and disable() callbacks
only get called when counting from and to zero.
While at it the kref stuff gets replaced with an int.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Magnus Damm
2009-05-08 08:23:29 +00:00
committed by Paul Mundt
parent 7d170b1bc5
commit 4f5ecaa054
2 changed files with 39 additions and 34 deletions

View File

@@ -1,7 +1,6 @@
#ifndef __ASM_SH_CLOCK_H
#define __ASM_SH_CLOCK_H
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/clk.h>
@@ -28,7 +27,7 @@ struct clk {
struct clk *parent;
struct clk_ops *ops;
struct kref kref;
int usecount;
unsigned long rate;
unsigned long flags;
@@ -37,6 +36,7 @@ struct clk {
#define CLK_ALWAYS_ENABLED (1 << 0)
#define CLK_RATE_PROPAGATES (1 << 1)
#define CLK_NEEDS_INIT (1 << 2)
/* Should be defined by processor-specific code */
void arch_init_clk_ops(struct clk_ops **, int type);