Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59253
b: refs/heads/master
c: f4b6a0a
h: refs/heads/master
i:
  59251: db98da2
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jul 12, 2007
1 parent 6c5ccda commit b4242f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f62c3f2c35874713ebbb6b6a4b9d9c6caaed4f14
refs/heads/master: f4b6a0a401f2cec5e6199e805ed42f30d8c04e94
15 changes: 7 additions & 8 deletions trunk/arch/arm/mach-pxa/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <asm/arch/pxa-regs.h>
#include <asm/hardware.h>
#include <asm/semaphore.h>

struct clk {
struct list_head node;
Expand All @@ -25,21 +24,21 @@ struct clk {
};

static LIST_HEAD(clocks);
static DECLARE_MUTEX(clocks_sem);
static DEFINE_MUTEX(clocks_mutex);
static DEFINE_SPINLOCK(clocks_lock);

struct clk *clk_get(struct device *dev, const char *id)
{
struct clk *p, *clk = ERR_PTR(-ENOENT);

down(&clocks_sem);
mutex_lock(&clocks_mutex);
list_for_each_entry(p, &clocks, node) {
if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
clk = p;
break;
}
}
up(&clocks_sem);
mutex_unlock(&clocks_mutex);

return clk;
}
Expand Down Expand Up @@ -101,18 +100,18 @@ static struct clk clk_gpio27 = {

int clk_register(struct clk *clk)
{
down(&clocks_sem);
mutex_lock(&clocks_mutex);
list_add(&clk->node, &clocks);
up(&clocks_sem);
mutex_unlock(&clocks_mutex);
return 0;
}
EXPORT_SYMBOL(clk_register);

void clk_unregister(struct clk *clk)
{
down(&clocks_sem);
mutex_lock(&clocks_mutex);
list_del(&clk->node);
up(&clocks_sem);
mutex_unlock(&clocks_mutex);
}
EXPORT_SYMBOL(clk_unregister);

Expand Down

0 comments on commit b4242f1

Please sign in to comment.