hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ppp/ppp_async.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * PPP async serial channel driver for Linux.
34 *
45 * Copyright 1999 Paul Mackerras.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 *
117 * This driver provides the encapsulation and framing for sending
128 * and receiving PPP frames over async serial lines. It relies on
....@@ -70,7 +66,7 @@
7066 struct tasklet_struct tsk;
7167
7268 refcount_t refcnt;
73
- struct semaphore dead_sem;
69
+ struct completion dead;
7470 struct ppp_channel chan; /* interface to generic ppp layer */
7571 unsigned char obuf[OBUFSIZE];
7672 };
....@@ -148,7 +144,7 @@
148144 static void ap_put(struct asyncppp *ap)
149145 {
150146 if (refcount_dec_and_test(&ap->refcnt))
151
- up(&ap->dead_sem);
147
+ complete(&ap->dead);
152148 }
153149
154150 /*
....@@ -186,7 +182,7 @@
186182 tasklet_init(&ap->tsk, ppp_async_process, (unsigned long) ap);
187183
188184 refcount_set(&ap->refcnt, 1);
189
- sema_init(&ap->dead_sem, 0);
185
+ init_completion(&ap->dead);
190186
191187 ap->chan.private = ap;
192188 ap->chan.ops = &async_ops;
....@@ -235,7 +231,7 @@
235231 * by the time it returns.
236232 */
237233 if (!refcount_dec_and_test(&ap->refcnt))
238
- down(&ap->dead_sem);
234
+ wait_for_completion(&ap->dead);
239235 tasklet_kill(&ap->tsk);
240236
241237 ppp_unregister_channel(&ap->chan);
....@@ -263,7 +259,8 @@
263259 */
264260 static ssize_t
265261 ppp_asynctty_read(struct tty_struct *tty, struct file *file,
266
- unsigned char __user *buf, size_t count)
262
+ unsigned char *buf, size_t count,
263
+ void **cookie, unsigned long offset)
267264 {
268265 return -EAGAIN;
269266 }