Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f4b6a0a4
Commit
f4b6a0a4
authored
May 15, 2007
by
Russell King
Committed by
Russell King
Jul 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] pxa: use mutexes instead of semaphores
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
f62c3f2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.c
+7
-8
No files found.
arch/arm/mach-pxa/clock.c
View file @
f4b6a0a4
...
...
@@ -12,7 +12,6 @@
#include <asm/arch/pxa-regs.h>
#include <asm/hardware.h>
#include <asm/semaphore.h>
struct
clk
{
struct
list_head
node
;
...
...
@@ -25,21 +24,21 @@ struct clk {
};
static
LIST_HEAD
(
clocks
);
static
DE
CLARE_MUTEX
(
clocks_sem
);
static
DE
FINE_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
;
}
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment