[PATCH 8/10] CardServices() removal from pcmcia net drivers

From: Andres Salomon
Date: Mon Dec 22 2003 - 01:27:53 EST


Part 8 of 10.
Revision: linux--mainline--2.6--patch-21
Archive: dilinger@xxxxxxxxxxxxxxxxxxxxxx
Creator: Andres Salomon <dilinger@xxxxxxxxx>
Date: Sun Dec 21 22:05:58 EST 2003
Standard-date: 2003-12-22 03:05:58 GMT
Modified-files: drivers/net/pcmcia/com20020_cs.c
New-patches: dilinger@xxxxxxxxxxxxxxxxxxxxxx/linux--mainline--2.6--patch-21
Summary: CardServices() removal, pt. 8
Keywords:

Remove calls to CardServices(), part 8; com20020_cs.c.

* added files

{arch}/linux/linux--mainline/linux--mainline--2.6/dilinger@xxxxxxxxxxxxxxxxxxxxxx/patch-log/patch-21

* modified files

--- orig/drivers/net/pcmcia/com20020_cs.c
+++ mod/drivers/net/pcmcia/com20020_cs.c
@@ -227,7 +227,7 @@
client_reg.event_handler = &com20020_event;
client_reg.Version = 0x0210;
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 != 0) {
cs_error(link->handle, RegisterClient, ret);
com20020_detach(link);
@@ -277,7 +277,7 @@
}

if (link->handle)
- CardServices(DeregisterClient, link->handle);
+ pcmcia_deregister_client(link->handle);

/* Unlink device structure, free bits */
DEBUG(1,"unlinking...\n");
@@ -325,8 +325,8 @@

======================================================================*/

-#define CS_CHECK(fn, args...) \
-while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
+#define CS_CHECK(fn, ret) \
+do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)

static void com20020_config(dev_link_t *link)
{
@@ -353,9 +353,9 @@
tuple.TupleDataMax = 64;
tuple.TupleOffset = 0;
tuple.DesiredTuple = CISTPL_CONFIG;
- CS_CHECK(GetFirstTuple, handle, &tuple);
- CS_CHECK(GetTupleData, handle, &tuple);
- CS_CHECK(ParseTuple, handle, &tuple, &parse);
+ CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
+ CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
+ CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
link->conf.ConfigBase = parse.config.base;

/* Configure card */
@@ -368,13 +368,13 @@
for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
{
link->io.BasePort1 = ioaddr;
- i = CardServices(RequestIO, link->handle, &link->io);
+ i = pcmcia_request_io(link->handle, &link->io);
if (i == CS_SUCCESS)
break;
}
}
else
- i = CardServices(RequestIO, link->handle, &link->io);
+ i = pcmcia_request_io(link->handle, &link->io);

if (i != CS_SUCCESS)
{
@@ -388,7 +388,7 @@
DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n",
link->irq.AssignedIRQ,
link->irq.IRQInfo1, link->irq.IRQInfo2);
- i = CardServices(RequestIRQ, link->handle, &link->irq);
+ i = pcmcia_request_irq(link->handle, &link->irq);
if (i != CS_SUCCESS)
{
DEBUG(1,"arcnet: requestIRQ failed totally!\n");
@@ -397,7 +397,7 @@

dev->irq = link->irq.AssignedIRQ;

- CS_CHECK(RequestConfiguration, link->handle, &link->conf);
+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));

if (com20020_check(dev))
{
@@ -454,9 +454,9 @@
return;
}

- CardServices(ReleaseConfiguration, link->handle);
- CardServices(ReleaseIO, link->handle, &link->io);
- CardServices(ReleaseIRQ, link->handle, &link->irq);
+ pcmcia_release_configuration(link->handle);
+ pcmcia_release_io(link->handle, &link->io);
+ pcmcia_release_irq(link->handle, &link->irq);

link->state &= ~(DEV_CONFIG | DEV_RELEASE_PENDING);

@@ -502,7 +502,7 @@
if (link->open) {
netif_device_detach(dev);
}
- CardServices(ReleaseConfiguration, link->handle);
+ pcmcia_release_configuration(link->handle);
}
break;
case CS_EVENT_PM_RESUME:
@@ -510,7 +510,7 @@
/* Fall through... */
case CS_EVENT_CARD_RESET:
if (link->state & DEV_CONFIG) {
- CardServices(RequestConfiguration, link->handle, &link->conf);
+ pcmcia_request_configuration(link->handle, &link->conf);
if (link->open) {
int ioaddr = dev->base_addr;
struct arcnet_local *lp = (struct arcnet_local *)dev->priv;



Attachment: signature.asc
Description: This is a digitally signed message part