Commit 95410090 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Remvoe CardServices() from drivers/serial

From: Russell King <rmk+lkml@arm.linux.org.uk>

Ok, this is the last patch for removal of CardServices()
parent 477792e7
...@@ -149,9 +149,9 @@ static void serial_remove(dev_link_t *link) ...@@ -149,9 +149,9 @@ static void serial_remove(dev_link_t *link)
info->link.dev = NULL; info->link.dev = NULL;
if (!info->slave) { if (!info->slave) {
CardServices(ReleaseConfiguration, info->link.handle); pcmcia_release_configuration(info->link.handle);
CardServices(ReleaseIO, info->link.handle, &info->link.io); pcmcia_release_io(info->link.handle, &info->link.io);
CardServices(ReleaseIRQ, info->link.handle, &info->link.irq); pcmcia_release_irq(info->link.handle, &info->link.irq);
} }
info->link.state &= ~DEV_CONFIG; info->link.state &= ~DEV_CONFIG;
...@@ -211,7 +211,7 @@ static dev_link_t *serial_attach(void) ...@@ -211,7 +211,7 @@ static dev_link_t *serial_attach(void)
client_reg.event_handler = &serial_event; client_reg.event_handler = &serial_event;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
ret = CardServices(RegisterClient, &link->handle, &client_reg); ret = pcmcia_register_client(&link->handle, &client_reg);
if (ret != CS_SUCCESS) { if (ret != CS_SUCCESS) {
cs_error(link->handle, RegisterClient, ret); cs_error(link->handle, RegisterClient, ret);
serial_detach(link); serial_detach(link);
...@@ -256,7 +256,7 @@ static void serial_detach(dev_link_t * link) ...@@ -256,7 +256,7 @@ static void serial_detach(dev_link_t * link)
serial_remove(link); serial_remove(link);
if (link->handle) { if (link->handle) {
ret = CardServices(DeregisterClient, link->handle); ret = pcmcia_deregister_client(link->handle);
if (ret != CS_SUCCESS) if (ret != CS_SUCCESS)
cs_error(link->handle, DeregisterClient, ret); cs_error(link->handle, DeregisterClient, ret);
} }
...@@ -306,10 +306,10 @@ get_tuple(int fn, client_handle_t handle, tuple_t * tuple, cisparse_t * parse) ...@@ -306,10 +306,10 @@ get_tuple(int fn, client_handle_t handle, tuple_t * tuple, cisparse_t * parse)
i = CardServices(fn, handle, tuple); i = CardServices(fn, handle, tuple);
if (i != CS_SUCCESS) if (i != CS_SUCCESS)
return CS_NO_MORE_ITEMS; return CS_NO_MORE_ITEMS;
i = CardServices(GetTupleData, handle, tuple); i = pcmcia_get_tuple_data(handle, tuple);
if (i != CS_SUCCESS) if (i != CS_SUCCESS)
return i; return i;
return CardServices(ParseTuple, handle, tuple, parse); return pcmcia_parse_tuple(handle, tuple, parse);
} }
#define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c) #define first_tuple(a, b, c) get_tuple(GetFirstTuple, a, b, c)
...@@ -330,7 +330,7 @@ static int simple_config(dev_link_t * link) ...@@ -330,7 +330,7 @@ static int simple_config(dev_link_t * link)
int i, j, try; int i, j, try;
/* If the card is already configured, look up the port and irq */ /* If the card is already configured, look up the port and irq */
i = CardServices(GetConfigurationInfo, handle, &config); i = pcmcia_get_configuration_info(handle, &config);
if ((i == CS_SUCCESS) && (config.Attributes & CONF_VALID_CLIENT)) { if ((i == CS_SUCCESS) && (config.Attributes & CONF_VALID_CLIENT)) {
ioaddr_t port = 0; ioaddr_t port = 0;
if ((config.BasePort2 != 0) && (config.NumPorts2 == 8)) { if ((config.BasePort2 != 0) && (config.NumPorts2 == 8)) {
...@@ -367,9 +367,7 @@ static int simple_config(dev_link_t * link) ...@@ -367,9 +367,7 @@ static int simple_config(dev_link_t * link)
link->io.BasePort1 = cf->io.win[0].base; link->io.BasePort1 = cf->io.win[0].base;
link->io.IOAddrLines = (try == 0) ? link->io.IOAddrLines = (try == 0) ?
16 : cf->io.flags & CISTPL_IO_LINES_MASK; 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
i = i = pcmcia_request_io(link->handle, &link->io);
CardServices(RequestIO, link->handle,
&link->io);
if (i == CS_SUCCESS) if (i == CS_SUCCESS)
goto found_port; goto found_port;
} }
...@@ -389,8 +387,7 @@ static int simple_config(dev_link_t * link) ...@@ -389,8 +387,7 @@ static int simple_config(dev_link_t * link)
for (j = 0; j < 5; j++) { for (j = 0; j < 5; j++) {
link->io.BasePort1 = base[j]; link->io.BasePort1 = base[j];
link->io.IOAddrLines = base[j] ? 16 : 3; link->io.IOAddrLines = base[j] ? 16 : 3;
i = CardServices(RequestIO, link->handle, i = pcmcia_request_io(link->handle, &link->io);
&link->io);
if (i == CS_SUCCESS) if (i == CS_SUCCESS)
goto found_port; goto found_port;
} }
...@@ -406,14 +403,14 @@ static int simple_config(dev_link_t * link) ...@@ -406,14 +403,14 @@ static int simple_config(dev_link_t * link)
return -1; return -1;
} }
i = CardServices(RequestIRQ, link->handle, &link->irq); i = pcmcia_request_irq(link->handle, &link->irq);
if (i != CS_SUCCESS) { if (i != CS_SUCCESS) {
cs_error(link->handle, RequestIRQ, i); cs_error(link->handle, RequestIRQ, i);
link->irq.AssignedIRQ = 0; link->irq.AssignedIRQ = 0;
} }
if (info->multi && (info->manfid == MANFID_3COM)) if (info->multi && (info->manfid == MANFID_3COM))
link->conf.ConfigIndex &= ~(0x08); link->conf.ConfigIndex &= ~(0x08);
i = CardServices(RequestConfiguration, link->handle, &link->conf); i = pcmcia_request_configuration(link->handle, &link->conf);
if (i != CS_SUCCESS) { if (i != CS_SUCCESS) {
cs_error(link->handle, RequestConfiguration, i); cs_error(link->handle, RequestConfiguration, i);
return -1; return -1;
...@@ -433,7 +430,7 @@ static int multi_config(dev_link_t * link) ...@@ -433,7 +430,7 @@ static int multi_config(dev_link_t * link)
config_info_t config; config_info_t config;
int i, base2 = 0; int i, base2 = 0;
i = CardServices(GetConfigurationInfo, handle, &config); i = pcmcia_get_configuration_info(handle, &config);
if (i != CS_SUCCESS) { if (i != CS_SUCCESS) {
cs_error(handle, GetConfigurationInfo, i); cs_error(handle, GetConfigurationInfo, i);
return -1; return -1;
...@@ -458,7 +455,7 @@ static int multi_config(dev_link_t * link) ...@@ -458,7 +455,7 @@ static int multi_config(dev_link_t * link)
link->io.BasePort1 = cf->io.win[0].base; link->io.BasePort1 = cf->io.win[0].base;
link->io.IOAddrLines = link->io.IOAddrLines =
cf->io.flags & CISTPL_IO_LINES_MASK; cf->io.flags & CISTPL_IO_LINES_MASK;
i = CardServices(RequestIO, link->handle, &link->io); i = pcmcia_request_io(link->handle, &link->io);
base2 = link->io.BasePort1 + 8; base2 = link->io.BasePort1 + 8;
if (i == CS_SUCCESS) if (i == CS_SUCCESS)
break; break;
...@@ -478,9 +475,7 @@ static int multi_config(dev_link_t * link) ...@@ -478,9 +475,7 @@ static int multi_config(dev_link_t * link)
link->io.BasePort2 = cf->io.win[1].base; link->io.BasePort2 = cf->io.win[1].base;
link->io.IOAddrLines = link->io.IOAddrLines =
cf->io.flags & CISTPL_IO_LINES_MASK; cf->io.flags & CISTPL_IO_LINES_MASK;
i = i = pcmcia_request_io(link->handle, &link->io);
CardServices(RequestIO, link->handle,
&link->io);
base2 = link->io.BasePort2; base2 = link->io.BasePort2;
if (i == CS_SUCCESS) if (i == CS_SUCCESS)
break; break;
...@@ -494,7 +489,7 @@ static int multi_config(dev_link_t * link) ...@@ -494,7 +489,7 @@ static int multi_config(dev_link_t * link)
return -1; return -1;
} }
i = CardServices(RequestIRQ, link->handle, &link->irq); i = pcmcia_request_irq(link->handle, &link->irq);
if (i != CS_SUCCESS) { if (i != CS_SUCCESS) {
printk(KERN_NOTICE printk(KERN_NOTICE
"serial_cs: no usable port range found, giving up\n"); "serial_cs: no usable port range found, giving up\n");
...@@ -506,7 +501,7 @@ static int multi_config(dev_link_t * link) ...@@ -506,7 +501,7 @@ static int multi_config(dev_link_t * link)
link->conf.Present |= PRESENT_EXT_STATUS; link->conf.Present |= PRESENT_EXT_STATUS;
link->conf.ExtStatus = ESR_REQ_ATTN_ENA; link->conf.ExtStatus = ESR_REQ_ATTN_ENA;
} }
i = CardServices(RequestConfiguration, link->handle, &link->conf); i = pcmcia_request_configuration(link->handle, &link->conf);
if (i != CS_SUCCESS) { if (i != CS_SUCCESS) {
cs_error(link->handle, RequestConfiguration, i); cs_error(link->handle, RequestConfiguration, i);
return -1; return -1;
...@@ -543,9 +538,6 @@ static int multi_config(dev_link_t * link) ...@@ -543,9 +538,6 @@ static int multi_config(dev_link_t * link)
======================================================================*/ ======================================================================*/
#define CS_CHECK(fn, args...) \
while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
void serial_config(dev_link_t * link) void serial_config(dev_link_t * link)
{ {
client_handle_t handle = link->handle; client_handle_t handle = link->handle;
...@@ -619,10 +611,18 @@ void serial_config(dev_link_t * link) ...@@ -619,10 +611,18 @@ void serial_config(dev_link_t * link)
if (info->manfid == MANFID_IBM) { if (info->manfid == MANFID_IBM) {
conf_reg_t reg = { 0, CS_READ, 0x800, 0 }; conf_reg_t reg = { 0, CS_READ, 0x800, 0 };
CS_CHECK(AccessConfigurationRegister, link->handle, &reg); last_ret = pcmcia_access_configuration_register(link->handle, &reg);
if (last_ret) {
last_fn = AccessConfigurationRegister;
goto cs_failed;
}
reg.Action = CS_WRITE; reg.Action = CS_WRITE;
reg.Value = reg.Value | 1; reg.Value = reg.Value | 1;
CS_CHECK(AccessConfigurationRegister, link->handle, &reg); last_ret = pcmcia_access_configuration_register(link->handle, &reg);
if (last_ret) {
last_fn = AccessConfigurationRegister;
goto cs_failed;
}
} }
link->dev = &info->node[0]; link->dev = &info->node[0];
...@@ -668,7 +668,7 @@ serial_event(event_t event, int priority, event_callback_args_t * args) ...@@ -668,7 +668,7 @@ serial_event(event_t event, int priority, event_callback_args_t * args)
/* Fall through... */ /* Fall through... */
case CS_EVENT_RESET_PHYSICAL: case CS_EVENT_RESET_PHYSICAL:
if ((link->state & DEV_CONFIG) && !info->slave) if ((link->state & DEV_CONFIG) && !info->slave)
CardServices(ReleaseConfiguration, link->handle); pcmcia_release_configuration(link->handle);
break; break;
case CS_EVENT_PM_RESUME: case CS_EVENT_PM_RESUME:
...@@ -676,8 +676,7 @@ serial_event(event_t event, int priority, event_callback_args_t * args) ...@@ -676,8 +676,7 @@ serial_event(event_t event, int priority, event_callback_args_t * args)
/* Fall through... */ /* Fall through... */
case CS_EVENT_CARD_RESET: case CS_EVENT_CARD_RESET:
if (DEV_OK(link) && !info->slave) if (DEV_OK(link) && !info->slave)
CardServices(RequestConfiguration, link->handle, pcmcia_request_configuration(link->handle, &link->conf);
&link->conf);
break; break;
} }
return 0; return 0;
......
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