forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/core/seq/seq_ports.c
....@@ -1,23 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA sequencer Ports
34 * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
45 * Jaroslav Kysela <perex@perex.cz>
5
- *
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
- *
216 */
227
238 #include <sound/core.h>
....@@ -128,7 +113,6 @@
128113 struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
129114 int port)
130115 {
131
- unsigned long flags;
132116 struct snd_seq_client_port *new_port, *p;
133117 int num = -1;
134118
....@@ -157,7 +141,7 @@
157141
158142 num = port >= 0 ? port : 0;
159143 mutex_lock(&client->ports_mutex);
160
- write_lock_irqsave(&client->ports_lock, flags);
144
+ write_lock_irq(&client->ports_lock);
161145 list_for_each_entry(p, &client->ports_list_head, list) {
162146 if (p->addr.port > num)
163147 break;
....@@ -169,7 +153,7 @@
169153 client->num_ports++;
170154 new_port->addr.port = num; /* store the port number in the port */
171155 sprintf(new_port->name, "port-%d", num);
172
- write_unlock_irqrestore(&client->ports_lock, flags);
156
+ write_unlock_irq(&client->ports_lock);
173157 mutex_unlock(&client->ports_mutex);
174158
175159 return new_port;
....@@ -283,11 +267,10 @@
283267 /* delete a port with the given port id */
284268 int snd_seq_delete_port(struct snd_seq_client *client, int port)
285269 {
286
- unsigned long flags;
287270 struct snd_seq_client_port *found = NULL, *p;
288271
289272 mutex_lock(&client->ports_mutex);
290
- write_lock_irqsave(&client->ports_lock, flags);
273
+ write_lock_irq(&client->ports_lock);
291274 list_for_each_entry(p, &client->ports_list_head, list) {
292275 if (p->addr.port == port) {
293276 /* ok found. delete from the list at first */
....@@ -297,7 +280,7 @@
297280 break;
298281 }
299282 }
300
- write_unlock_irqrestore(&client->ports_lock, flags);
283
+ write_unlock_irq(&client->ports_lock);
301284 mutex_unlock(&client->ports_mutex);
302285 if (found)
303286 return port_delete(client, found);
....@@ -308,7 +291,6 @@
308291 /* delete the all ports belonging to the given client */
309292 int snd_seq_delete_all_ports(struct snd_seq_client *client)
310293 {
311
- unsigned long flags;
312294 struct list_head deleted_list;
313295 struct snd_seq_client_port *port, *tmp;
314296
....@@ -316,7 +298,7 @@
316298 * clear the port list in the client data.
317299 */
318300 mutex_lock(&client->ports_mutex);
319
- write_lock_irqsave(&client->ports_lock, flags);
301
+ write_lock_irq(&client->ports_lock);
320302 if (! list_empty(&client->ports_list_head)) {
321303 list_add(&deleted_list, &client->ports_list_head);
322304 list_del_init(&client->ports_list_head);
....@@ -324,7 +306,7 @@
324306 INIT_LIST_HEAD(&deleted_list);
325307 }
326308 client->num_ports = 0;
327
- write_unlock_irqrestore(&client->ports_lock, flags);
309
+ write_unlock_irq(&client->ports_lock);
328310
329311 /* remove each port in deleted_list */
330312 list_for_each_entry_safe(port, tmp, &deleted_list, list) {