Commit 6ea2d1e6 authored by Russell King's avatar Russell King

[PCMCIA] move_pcmcia_bind_device

Patch from Dominik Brodowski, updated by Russell King.
 
pcmcia_bind_device was only used by ds.c, and it is only used for
16-bit PCMCIA devices. So, move it to ds.c.
parent 3fdda634
...@@ -984,41 +984,6 @@ int pcmcia_access_configuration_register(client_handle_t handle, ...@@ -984,41 +984,6 @@ int pcmcia_access_configuration_register(client_handle_t handle,
return CS_SUCCESS; return CS_SUCCESS;
} /* access_configuration_register */ } /* access_configuration_register */
/*======================================================================
Bind_device() associates a device driver with a particular socket.
It is normally called by Driver Services after it has identified
a newly inserted card. An instance of that driver will then be
eligible to register as a client of this socket.
======================================================================*/
int pcmcia_bind_device(bind_req_t *req)
{
client_t *client;
struct pcmcia_socket *s;
s = req->Socket;
if (!s)
return CS_BAD_SOCKET;
client = (client_t *)kmalloc(sizeof(client_t), GFP_KERNEL);
if (!client) return CS_OUT_OF_RESOURCE;
memset(client, '\0', sizeof(client_t));
client->client_magic = CLIENT_MAGIC;
strlcpy(client->dev_info, (char *)req->dev_info, DEV_NAME_LEN);
client->Socket = s;
client->Function = req->Function;
client->state = CLIENT_UNBOUND;
client->erase_busy.next = &client->erase_busy;
client->erase_busy.prev = &client->erase_busy;
init_waitqueue_head(&client->mtd_req);
client->next = s->clients;
s->clients = client;
cs_dbg(s, 1, "bind_device(): client 0x%p, dev %s\n",
client, client->dev_info);
return CS_SUCCESS;
} /* bind_device */
/*====================================================================== /*======================================================================
...@@ -2304,7 +2269,6 @@ int pcmcia_report_error(client_handle_t handle, error_info_t *err) ...@@ -2304,7 +2269,6 @@ int pcmcia_report_error(client_handle_t handle, error_info_t *err)
/* in alpha order */ /* in alpha order */
EXPORT_SYMBOL(pcmcia_access_configuration_register); EXPORT_SYMBOL(pcmcia_access_configuration_register);
EXPORT_SYMBOL(pcmcia_adjust_resource_info); EXPORT_SYMBOL(pcmcia_adjust_resource_info);
EXPORT_SYMBOL(pcmcia_bind_device);
EXPORT_SYMBOL(pcmcia_bind_mtd); EXPORT_SYMBOL(pcmcia_bind_mtd);
EXPORT_SYMBOL(pcmcia_check_erase_queue); EXPORT_SYMBOL(pcmcia_check_erase_queue);
EXPORT_SYMBOL(pcmcia_close_memory); EXPORT_SYMBOL(pcmcia_close_memory);
......
...@@ -62,6 +62,8 @@ ...@@ -62,6 +62,8 @@
#include <pcmcia/ds.h> #include <pcmcia/ds.h>
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
#include "cs_internal.h"
/*====================================================================*/ /*====================================================================*/
/* Module parameters */ /* Module parameters */
...@@ -134,6 +136,50 @@ extern struct proc_dir_entry *proc_pccard; ...@@ -134,6 +136,50 @@ extern struct proc_dir_entry *proc_pccard;
/*====================================================================*/ /*====================================================================*/
/* code which was in cs.c before */
/*======================================================================
Bind_device() associates a device driver with a particular socket.
It is normally called by Driver Services after it has identified
a newly inserted card. An instance of that driver will then be
eligible to register as a client of this socket.
======================================================================*/
static int pcmcia_bind_device(bind_req_t *req)
{
client_t *client;
struct pcmcia_socket *s;
s = req->Socket;
if (!s)
return CS_BAD_SOCKET;
client = (client_t *) kmalloc(sizeof(client_t), GFP_KERNEL);
if (!client)
return CS_OUT_OF_RESOURCE;
memset(client, '\0', sizeof(client_t));
client->client_magic = CLIENT_MAGIC;
strlcpy(client->dev_info, (char *)req->dev_info, DEV_NAME_LEN);
client->Socket = s;
client->Function = req->Function;
client->state = CLIENT_UNBOUND;
client->erase_busy.next = &client->erase_busy;
client->erase_busy.prev = &client->erase_busy;
init_waitqueue_head(&client->mtd_req);
client->next = s->clients;
s->clients = client;
ds_dbg(1, "%s: bind_device(): client 0x%p, dev %s\n",
cs_socket_name(client->Socket), client, client->dev_info);
return CS_SUCCESS;
} /* bind_device */
/* end of code which was in cs.c before */
/*======================================================================*/
void cs_error(client_handle_t handle, int func, int ret) void cs_error(client_handle_t handle, int func, int ret)
{ {
error_info_t err = { func, ret }; error_info_t err = { func, ret };
......
...@@ -422,7 +422,6 @@ enum service { ...@@ -422,7 +422,6 @@ enum service {
}; };
int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg); int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
int pcmcia_bind_device(bind_req_t *req);
int pcmcia_bind_mtd(mtd_bind_t *req); int pcmcia_bind_mtd(mtd_bind_t *req);
int pcmcia_deregister_client(client_handle_t handle); int pcmcia_deregister_client(client_handle_t handle);
int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config); int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment