Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
0bec0bba
Commit
0bec0bba
authored
May 15, 2008
by
Jonathan Corbet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcmcia: cdev lock_kernel() pushdown
Signed-off-by:
Jonathan Corbet
<
corbet@lwn.net
>
parent
09118107
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
drivers/pcmcia/pcmcia_ioctl.c
drivers/pcmcia/pcmcia_ioctl.c
+18
-7
No files found.
drivers/pcmcia/pcmcia_ioctl.c
View file @
0bec0bba
...
...
@@ -27,6 +27,7 @@
#include <linux/proc_fs.h>
#include <linux/poll.h>
#include <linux/pci.h>
#include <linux/smp_lock.h>
#include <linux/workqueue.h>
#define IN_CARD_SERVICES
...
...
@@ -397,20 +398,27 @@ static int ds_open(struct inode *inode, struct file *file)
struct
pcmcia_socket
*
s
;
user_info_t
*
user
;
static
int
warning_printed
=
0
;
int
ret
=
0
;
ds_dbg
(
0
,
"ds_open(socket %d)
\n
"
,
i
);
lock_kernel
();
s
=
pcmcia_get_socket_by_nr
(
i
);
if
(
!
s
)
return
-
ENODEV
;
if
(
!
s
)
{
ret
=
-
ENODEV
;
goto
out
;
}
s
=
pcmcia_get_socket
(
s
);
if
(
!
s
)
return
-
ENODEV
;
if
(
!
s
)
{
ret
=
-
ENODEV
;
goto
out
;
}
if
((
file
->
f_flags
&
O_ACCMODE
)
!=
O_RDONLY
)
{
if
(
s
->
pcmcia_state
.
busy
)
{
pcmcia_put_socket
(
s
);
return
-
EBUSY
;
ret
=
-
EBUSY
;
goto
out
;
}
else
s
->
pcmcia_state
.
busy
=
1
;
...
...
@@ -419,7 +427,8 @@ static int ds_open(struct inode *inode, struct file *file)
user
=
kmalloc
(
sizeof
(
user_info_t
),
GFP_KERNEL
);
if
(
!
user
)
{
pcmcia_put_socket
(
s
);
return
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
out
;
}
user
->
event_tail
=
user
->
event_head
=
0
;
user
->
next
=
s
->
user
;
...
...
@@ -441,7 +450,9 @@ static int ds_open(struct inode *inode, struct file *file)
if
(
s
->
pcmcia_state
.
present
)
queue_event
(
user
,
CS_EVENT_CARD_INSERTION
);
return
0
;
out:
unlock_kernel
();
return
ret
;
}
/* ds_open */
/*====================================================================*/
...
...
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