-int pcmcia_deregister_client(client_handle_t handle)
-{
- client_t **client;
- struct pcmcia_socket *s;
- memory_handle_t region;
- u_long flags;
- int i;
-
- if (CHECK_HANDLE(handle))
- return CS_BAD_HANDLE;
-
- s = SOCKET(handle);
- cs_dbg(s, 1, "deregister_client(%p)\n", handle);
-
- if (handle->state &
- (CLIENT_IRQ_REQ|CLIENT_IO_REQ|CLIENT_CONFIG_LOCKED))
- return CS_IN_USE;
- for (i = 0; i < MAX_WIN; i++)
- if (handle->state & CLIENT_WIN_REQ(i))
- return CS_IN_USE;
-
- /* Disconnect all MTD links */
- if (handle->mtd_count) {
- for (region = s->a_region; region; region = region->info.next)
- if (region->mtd == handle) region->mtd = NULL;
- for (region = s->c_region; region; region = region->info.next)
- if (region->mtd == handle) region->mtd = NULL;
- }
-
- if ((handle->state & CLIENT_STALE) ||
- (handle->Attributes & INFO_MASTER_CLIENT)) {
- spin_lock_irqsave(&s->lock, flags);
- client = &s->clients;
- while ((*client) && ((*client) != handle))
- client = &(*client)->next;
- if (*client == NULL) {
- spin_unlock_irqrestore(&s->lock, flags);
- return CS_BAD_HANDLE;
- }
- *client = handle->next;
- handle->client_magic = 0;
- kfree(handle);
- spin_unlock_irqrestore(&s->lock, flags);
- } else {
- handle->state = CLIENT_UNBOUND;
- handle->mtd_count = 0;
- handle->event_handler = NULL;
- }
-
- return CS_SUCCESS;
-} /* deregister_client */
-
-/*====================================================================*/
-
-int pcmcia_get_configuration_info(client_handle_t handle,