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
09118107
Commit
09118107
authored
May 15, 2008
by
Jonathan Corbet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosa: cdev lock_kernel() pushdown
Signed-off-by:
Jonathan Corbet
<
corbet@lwn.net
>
parent
3db633ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
drivers/net/wan/cosa.c
drivers/net/wan/cosa.c
+16
-6
No files found.
drivers/net/wan/cosa.c
View file @
09118107
...
...
@@ -92,6 +92,7 @@
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/smp_lock.h>
#undef COSA_SLOW_IO
/* for testing purposes only */
...
...
@@ -970,15 +971,21 @@ static int cosa_open(struct inode *inode, struct file *file)
struct
channel_data
*
chan
;
unsigned
long
flags
;
int
n
;
int
ret
=
0
;
lock_kernel
();
if
((
n
=
iminor
(
file
->
f_path
.
dentry
->
d_inode
)
>>
CARD_MINOR_BITS
)
>=
nr_cards
)
return
-
ENODEV
;
>=
nr_cards
)
{
ret
=
-
ENODEV
;
goto
out
;
}
cosa
=
cosa_cards
+
n
;
if
((
n
=
iminor
(
file
->
f_path
.
dentry
->
d_inode
)
&
((
1
<<
CARD_MINOR_BITS
)
-
1
))
>=
cosa
->
nchannels
)
return
-
ENODEV
;
&
((
1
<<
CARD_MINOR_BITS
)
-
1
))
>=
cosa
->
nchannels
)
{
ret
=
-
ENODEV
;
goto
out
;
}
chan
=
cosa
->
chan
+
n
;
file
->
private_data
=
chan
;
...
...
@@ -987,7 +994,8 @@ static int cosa_open(struct inode *inode, struct file *file)
if
(
chan
->
usage
<
0
)
{
/* in netdev mode */
spin_unlock_irqrestore
(
&
cosa
->
lock
,
flags
);
return
-
EBUSY
;
ret
=
-
EBUSY
;
goto
out
;
}
cosa
->
usage
++
;
chan
->
usage
++
;
...
...
@@ -996,7 +1004,9 @@ static int cosa_open(struct inode *inode, struct file *file)
chan
->
setup_rx
=
chrdev_setup_rx
;
chan
->
rx_done
=
chrdev_rx_done
;
spin_unlock_irqrestore
(
&
cosa
->
lock
,
flags
);
return
0
;
out:
unlock_kernel
();
return
ret
;
}
static
int
cosa_release
(
struct
inode
*
inode
,
struct
file
*
file
)
...
...
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