aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp_synctty.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ppp_synctty.c')
-rw-r--r--drivers/net/ppp_synctty.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index 1b3f75febee..aa3d39f38e2 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -182,15 +182,13 @@ static DEFINE_RWLOCK(disc_data_lock);
182 182
183static struct syncppp *sp_get(struct tty_struct *tty) 183static struct syncppp *sp_get(struct tty_struct *tty)
184{ 184{
185 unsigned long flags;
186 struct syncppp *ap; 185 struct syncppp *ap;
187 186
188 read_lock_irqsave(&disc_data_lock, flags); 187 read_lock(&disc_data_lock);
189 ap = tty->disc_data; 188 ap = tty->disc_data;
190 if (ap != NULL) 189 if (ap != NULL)
191 atomic_inc(&ap->refcnt); 190 atomic_inc(&ap->refcnt);
192 read_unlock_irqrestore(&disc_data_lock, flags); 191 read_unlock(&disc_data_lock);
193
194 return ap; 192 return ap;
195} 193}
196 194
@@ -264,13 +262,12 @@ ppp_sync_open(struct tty_struct *tty)
264static void 262static void
265ppp_sync_close(struct tty_struct *tty) 263ppp_sync_close(struct tty_struct *tty)
266{ 264{
267 unsigned long flags;
268 struct syncppp *ap; 265 struct syncppp *ap;
269 266
270 write_lock_irqsave(&disc_data_lock, flags); 267 write_lock_irq(&disc_data_lock);
271 ap = tty->disc_data; 268 ap = tty->disc_data;
272 tty->disc_data = NULL; 269 tty->disc_data = NULL;
273 write_unlock_irqrestore(&disc_data_lock, flags); 270 write_unlock_irq(&disc_data_lock);
274 if (!ap) 271 if (!ap)
275 return; 272 return;
276 273