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
d41f9a85
Commit
d41f9a85
authored
Jul 28, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hamradio: Convert to anon_semaphore
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
0d90b99b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
drivers/net/hamradio/6pack.c
drivers/net/hamradio/6pack.c
+4
-4
drivers/net/hamradio/mkiss.c
drivers/net/hamradio/mkiss.c
+4
-4
No files found.
drivers/net/hamradio/6pack.c
View file @
d41f9a85
...
@@ -120,7 +120,7 @@ struct sixpack {
...
@@ -120,7 +120,7 @@ struct sixpack {
struct
timer_list
tx_t
;
struct
timer_list
tx_t
;
struct
timer_list
resync_t
;
struct
timer_list
resync_t
;
atomic_t
refcnt
;
atomic_t
refcnt
;
struct
semaphore
dead_sem
;
struct
anon_
semaphore
dead_sem
;
spinlock_t
lock
;
spinlock_t
lock
;
};
};
...
@@ -412,7 +412,7 @@ static struct sixpack *sp_get(struct tty_struct *tty)
...
@@ -412,7 +412,7 @@ static struct sixpack *sp_get(struct tty_struct *tty)
static
void
sp_put
(
struct
sixpack
*
sp
)
static
void
sp_put
(
struct
sixpack
*
sp
)
{
{
if
(
atomic_dec_and_test
(
&
sp
->
refcnt
))
if
(
atomic_dec_and_test
(
&
sp
->
refcnt
))
up
(
&
sp
->
dead_sem
);
anon_
up
(
&
sp
->
dead_sem
);
}
}
/*
/*
...
@@ -606,7 +606,7 @@ static int sixpack_open(struct tty_struct *tty)
...
@@ -606,7 +606,7 @@ static int sixpack_open(struct tty_struct *tty)
spin_lock_init
(
&
sp
->
lock
);
spin_lock_init
(
&
sp
->
lock
);
atomic_set
(
&
sp
->
refcnt
,
1
);
atomic_set
(
&
sp
->
refcnt
,
1
);
semaphore_init_locked
(
&
sp
->
dead_sem
);
anon_
semaphore_init_locked
(
&
sp
->
dead_sem
);
/* !!! length of the buffers. MTU is IP MTU, not PACLEN! */
/* !!! length of the buffers. MTU is IP MTU, not PACLEN! */
...
@@ -702,7 +702,7 @@ static void sixpack_close(struct tty_struct *tty)
...
@@ -702,7 +702,7 @@ static void sixpack_close(struct tty_struct *tty)
* we have to wait for all existing users to finish.
* we have to wait for all existing users to finish.
*/
*/
if
(
!
atomic_dec_and_test
(
&
sp
->
refcnt
))
if
(
!
atomic_dec_and_test
(
&
sp
->
refcnt
))
down
(
&
sp
->
dead_sem
);
anon_
down
(
&
sp
->
dead_sem
);
unregister_netdev
(
sp
->
dev
);
unregister_netdev
(
sp
->
dev
);
...
...
drivers/net/hamradio/mkiss.c
View file @
d41f9a85
...
@@ -82,7 +82,7 @@ struct mkiss {
...
@@ -82,7 +82,7 @@ struct mkiss {
#define CRC_MODE_SMACK_TEST 4
#define CRC_MODE_SMACK_TEST 4
atomic_t
refcnt
;
atomic_t
refcnt
;
struct
semaphore
dead_sem
;
struct
anon_
semaphore
dead_sem
;
};
};
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
...
@@ -718,7 +718,7 @@ static struct mkiss *mkiss_get(struct tty_struct *tty)
...
@@ -718,7 +718,7 @@ static struct mkiss *mkiss_get(struct tty_struct *tty)
static
void
mkiss_put
(
struct
mkiss
*
ax
)
static
void
mkiss_put
(
struct
mkiss
*
ax
)
{
{
if
(
atomic_dec_and_test
(
&
ax
->
refcnt
))
if
(
atomic_dec_and_test
(
&
ax
->
refcnt
))
up
(
&
ax
->
dead_sem
);
anon_
up
(
&
ax
->
dead_sem
);
}
}
static
int
crc_force
=
0
;
/* Can be overridden with insmod */
static
int
crc_force
=
0
;
/* Can be overridden with insmod */
...
@@ -745,7 +745,7 @@ static int mkiss_open(struct tty_struct *tty)
...
@@ -745,7 +745,7 @@ static int mkiss_open(struct tty_struct *tty)
spin_lock_init
(
&
ax
->
buflock
);
spin_lock_init
(
&
ax
->
buflock
);
atomic_set
(
&
ax
->
refcnt
,
1
);
atomic_set
(
&
ax
->
refcnt
,
1
);
semaphore_init_locked
(
&
ax
->
dead_sem
);
anon_
semaphore_init_locked
(
&
ax
->
dead_sem
);
ax
->
tty
=
tty
;
ax
->
tty
=
tty
;
tty
->
disc_data
=
ax
;
tty
->
disc_data
=
ax
;
...
@@ -824,7 +824,7 @@ static void mkiss_close(struct tty_struct *tty)
...
@@ -824,7 +824,7 @@ static void mkiss_close(struct tty_struct *tty)
* we have to wait for all existing users to finish.
* we have to wait for all existing users to finish.
*/
*/
if
(
!
atomic_dec_and_test
(
&
ax
->
refcnt
))
if
(
!
atomic_dec_and_test
(
&
ax
->
refcnt
))
down
(
&
ax
->
dead_sem
);
anon_
down
(
&
ax
->
dead_sem
);
unregister_netdev
(
ax
->
dev
);
unregister_netdev
(
ax
->
dev
);
...
...
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