]> git.hungrycats.org Git - linux/commitdiff
[PCMCIA] move_pcmcia_bind_mtd
authorRussell King <rmk@flint.arm.linux.org.uk>
Sun, 14 Mar 2004 20:27:59 +0000 (20:27 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 14 Mar 2004 20:27:59 +0000 (20:27 +0000)
Patch from Dominik Brodowski, updated by Russell King.

pcmcia_bind_mtd 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 ef1f72bc95dae97c754e551595ddfbe1536b6dd4..afdbd59520bd57e788e4f21fcef64710a1202895 100644 (file)
@@ -985,42 +985,6 @@ int pcmcia_access_configuration_register(client_handle_t handle,
 } /* access_configuration_register */
 
 
-/*======================================================================
-
-    Bind_mtd() associates a device driver with a particular memory
-    region.  It is normally called by Driver Services after it has
-    identified a memory device type.  An instance of the corresponding
-    driver will then be able to register to control this region.
-    
-======================================================================*/
-
-int pcmcia_bind_mtd(mtd_bind_t *req)
-{
-    struct pcmcia_socket *s;
-    memory_handle_t region;
-    
-    s = req->Socket;
-    if (!s)
-           return CS_BAD_SOCKET;
-    
-    if (req->Attributes & REGION_TYPE_AM)
-       region = s->a_region;
-    else
-       region = s->c_region;
-    
-    while (region) {
-       if (region->info.CardOffset == req->CardOffset) break;
-       region = region->info.next;
-    }
-    if (!region || (region->mtd != NULL))
-       return CS_BAD_OFFSET;
-    strlcpy(region->dev_info, (char *)req->dev_info, DEV_NAME_LEN);
-    
-    cs_dbg(s, 1, "bind_mtd(): attr 0x%x, offset 0x%x, dev %s\n",
-          req->Attributes, req->CardOffset, (char *)req->dev_info);
-    return CS_SUCCESS;
-} /* bind_mtd */
-
 /*====================================================================*/
 
 int pcmcia_deregister_client(client_handle_t handle)
@@ -2269,7 +2233,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_mtd);
 EXPORT_SYMBOL(pcmcia_check_erase_queue);
 EXPORT_SYMBOL(pcmcia_close_memory);
 EXPORT_SYMBOL(pcmcia_copy_memory);
index fadb6c1551518d7207638a1b4f94a5a5681215c4..1ead79fd12d2d697bdf5618b5bf40b8a1bf67d0e 100644 (file)
@@ -176,6 +176,45 @@ static int pcmcia_bind_device(bind_req_t *req)
 } /* bind_device */
 
 
+/*======================================================================
+
+    Bind_mtd() associates a device driver with a particular memory
+    region.  It is normally called by Driver Services after it has
+    identified a memory device type.  An instance of the corresponding
+    driver will then be able to register to control this region.
+    
+======================================================================*/
+
+static int pcmcia_bind_mtd(mtd_bind_t *req)
+{
+       struct pcmcia_socket *s;
+       memory_handle_t region;
+
+       s = req->Socket;
+       if (!s)
+               return CS_BAD_SOCKET;
+    
+       if (req->Attributes & REGION_TYPE_AM)
+               region = s->a_region;
+       else
+               region = s->c_region;
+
+       while (region) {
+               if (region->info.CardOffset == req->CardOffset) 
+                       break;
+               region = region->info.next;
+       }
+       if (!region || (region->mtd != NULL))
+               return CS_BAD_OFFSET;
+       strlcpy(region->dev_info, (char *)req->dev_info, DEV_NAME_LEN);
+
+       ds_dbg(1, "%s: bind_mtd: attr 0x%x, offset 0x%x, dev %s\n",
+             cs_socket_name(s), req->Attributes, req->CardOffset,
+             (char *)req->dev_info);
+       return CS_SUCCESS;
+} /* bind_mtd */
+
+
 /* end of code which was in cs.c before */
 
 /*======================================================================*/
index c2f7a487f0ffc4aaa58fa3a6eedc8b10ea448667..d6b5fba20a1c3e7f53a2073d9cbddc52c3329fa2 100644 (file)
@@ -422,7 +422,6 @@ enum service {
 };
 
 int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg);
-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);
 int pcmcia_get_card_services_info(servinfo_t *info);