/* pcmcia_unregister_socket - remove a pcmcia socket device @socket: the &socket to unregister  */
void pcmcia_unregister_socket(struct pcmcia_socket *socket)
/* pcmcia_unregister_socket - remove a pcmcia socket device @socket: the &socket to unregister  */
void pcmcia_unregister_socket(struct pcmcia_socket *socket)
{
	if (!socket)
		return;
	dev_dbg(&socket->dev, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
	if (socket->thread)
		kthread_stop(socket->thread);
	release_cis_mem(socket);
	down_write(&pcmcia_socket_list_rwsem);
	list_del(&socket->socket_list);
	up_write(&pcmcia_socket_list_rwsem);
	release_resource_db(socket);
	wait_for_completion(&socket->socket_released);
}