Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr-switch-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
white-rabbit
wr-switch-sw
Commits
a7ec7e40
Commit
a7ec7e40
authored
Feb 07, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_nic: use_count only if WR_IS_SWITCH
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
c4675c82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
device.c
kernel/wr_nic/device.c
+12
-8
No files found.
kernel/wr_nic/device.c
View file @
a7ec7e40
...
...
@@ -30,9 +30,11 @@ static int wrn_remove(struct platform_device *pdev)
struct
wrn_dev
*
wrn
=
pdev
->
dev
.
platform_data
;
int
i
;
spin_lock
(
&
wrn
->
lock
);
--
wrn
->
use_count
;
/* Hmmm... looks like overkill... */
spin_unlock
(
&
wrn
->
lock
);
if
(
WR_IS_SWITCH
)
{
spin_lock
(
&
wrn
->
lock
);
--
wrn
->
use_count
;
/* Hmmm... looks like overkill... */
spin_unlock
(
&
wrn
->
lock
);
}
/* First of all, stop any transmission */
writel
(
0
,
&
wrn
->
regs
->
CR
);
...
...
@@ -104,13 +106,15 @@ static int __devinit wrn_probe(struct platform_device *pdev)
static
irq_handler_t
irq_handlers
[]
=
WRN_IRQ_HANDLERS
;
/* No need to lock_irq: we only protect count and continue unlocked */
spin_lock
(
&
wrn
->
lock
);
if
(
++
wrn
->
use_count
!=
1
)
{
--
wrn
->
use_count
;
if
(
WR_IS_SWITCH
)
{
spin_lock
(
&
wrn
->
lock
);
if
(
++
wrn
->
use_count
!=
1
)
{
--
wrn
->
use_count
;
spin_unlock
(
&
wrn
->
lock
);
return
-
EBUSY
;
}
spin_unlock
(
&
wrn
->
lock
);
return
-
EBUSY
;
}
spin_unlock
(
&
wrn
->
lock
);
/* Map our resource list and instantiate the shortcut pointers */
if
(
(
err
=
__wrn_map_resources
(
pdev
))
)
...
...
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