Commit 138314e1 authored by Russell King's avatar Russell King

[PCMCIA] move_pcmcia_bind_mtd

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.
parent 6ea2d1e6
......@@ -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);
......
......@@ -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 */
/*======================================================================*/
......
......@@ -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);
......
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