port_subs_info_init(&new_port->c_dest);
num = port >= 0 ? port : 0;
- mutex_lock(&client->ports_mutex);
+ down(&client->ports_mutex);
write_lock_irqsave(&client->ports_lock, flags);
list_for_each(l, &client->ports_list_head) {
struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list);
client->num_ports++;
new_port->addr.port = num; /* store the port number in the port */
write_unlock_irqrestore(&client->ports_lock, flags);
- mutex_unlock(&client->ports_mutex);
+ up(&client->ports_mutex);
sprintf(new_port->name, "port-%d", num);
return new_port;
struct list_head *l;
struct snd_seq_client_port *found = NULL;
- mutex_lock(&client->ports_mutex);
+ down(&client->ports_mutex);
write_lock_irqsave(&client->ports_lock, flags);
list_for_each(l, &client->ports_list_head) {
struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list);
}
}
write_unlock_irqrestore(&client->ports_lock, flags);
- mutex_unlock(&client->ports_mutex);
+ up(&client->ports_mutex);
if (found)
return port_delete(client, found);
else
/* move the port list to deleted_list, and
* clear the port list in the client data.
*/
- mutex_lock(&client->ports_mutex);
+ down(&client->ports_mutex);
write_lock_irqsave(&client->ports_lock, flags);
if (! list_empty(&client->ports_list_head)) {
- list_add(&deleted_list, &client->ports_list_head);
- list_del_init(&client->ports_list_head);
+ __list_add(&deleted_list,
+ client->ports_list_head.prev,
+ client->ports_list_head.next);
+ INIT_LIST_HEAD(&client->ports_list_head);
} else {
INIT_LIST_HEAD(&deleted_list);
}
snd_seq_system_client_ev_port_exit(port->addr.client, port->addr.port);
port_delete(client, port);
}
- mutex_unlock(&client->ports_mutex);
+ up(&client->ports_mutex);
return 0;
}