]> git.neil.brown.name Git - history.git/commitdiff
[PCMCIA] move_pcmcia_bind_device
authorRussell King <rmk@flint.arm.linux.org.uk>
Sun, 14 Mar 2004 20:24:19 +0000 (20:24 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 14 Mar 2004 20:24:19 +0000 (20:24 +0000)
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.

drivers/pcmcia/cs.c
drivers/pcmcia/ds.c
include/pcmcia/cs.h

index 0d2bd0fd5e4238471704476d0d9f2f7e50c60acf..ef1f72bc95dae97c754e551595ddfbe1536b6dd4 100644 (file)
@@ -984,41 +984,6 @@ int pcmcia_access_configuration_register(client_handle_t handle,
     return CS_SUCCESS;
 } /* 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)
 /* in alpha order */
 EXPORT_SYMBOL(pcmcia_access_configuration_register);
 EXPORT_SYMBOL(pcmcia_adjust_resource_info);
-EXPORT_SYMBOL(pcmcia_bind_device);
 EXPORT_SYMBOL(pcmcia_bind_mtd);
 EXPORT_SYMBOL(pcmcia_check_erase_queue);
 EXPORT_SYMBOL(pcmcia_close_memory);
index 4f08f001d69f47d58a4ddeed8b7ca61259da12fa..fadb6c1551518d7207638a1b4f94a5a5681215c4 100644 (file)
@@ -62,6 +62,8 @@
 #include <pcmcia/ds.h>
 #include <pcmcia/ss.h>
 
+#include "cs_internal.h"
+
 /*====================================================================*/
 
 /* Module parameters */
@@ -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)
 {
        error_info_t err = { func, ret };
index f604480b85a04b5a265581f1167aa2b2a96f2a86..c2f7a487f0ffc4aaa58fa3a6eedc8b10ea448667 100644 (file)
@@ -422,7 +422,6 @@ enum service {
 };
 
 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_deregister_client(client_handle_t handle);
 int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config);