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
51a776fa
Commit
51a776fa
authored
May 15, 2008
by
Jonathan Corbet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtc: cdev lock_kernel() pushdown
Signed-off-by:
Jonathan Corbet
<
corbet@lwn.net
>
parent
0bec0bba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
drivers/rtc/rtc-dev.c
drivers/rtc/rtc-dev.c
+9
-3
No files found.
drivers/rtc/rtc-dev.c
View file @
51a776fa
...
...
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/rtc.h>
#include <linux/smp_lock.h>
#include "rtc-core.h"
static
dev_t
rtc_devt
;
...
...
@@ -26,8 +27,11 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
struct
rtc_device
,
char_dev
);
const
struct
rtc_class_ops
*
ops
=
rtc
->
ops
;
if
(
test_and_set_bit_lock
(
RTC_DEV_BUSY
,
&
rtc
->
flags
))
return
-
EBUSY
;
lock_kernel
();
if
(
test_and_set_bit_lock
(
RTC_DEV_BUSY
,
&
rtc
->
flags
))
{
err
=
-
EBUSY
;
goto
out
;
}
file
->
private_data
=
rtc
;
...
...
@@ -37,11 +41,13 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
rtc
->
irq_data
=
0
;
spin_unlock_irq
(
&
rtc
->
irq_lock
);
return
0
;
goto
out
;
}
/* something has gone wrong */
clear_bit_unlock
(
RTC_DEV_BUSY
,
&
rtc
->
flags
);
out:
unlock_kernel
();
return
err
;
}
...
...
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