[PATCH] kill remaining pcmcia release timers
Christoph Hellwig
hch at lst.de
Fri Aug 8 21:05:40 BST 2003
The scsi ones are already gone in jejb's tree, I'll post a patch
to kill the struct fields once the scsi tree and this patch end
up merged in mainline.
--- 1.11/drivers/bluetooth/bluecard_cs.c Wed Apr 30 00:46:16 2003
+++ edited/drivers/bluetooth/bluecard_cs.c Thu Jul 24 01:23:07 2003
@@ -90,7 +90,7 @@
void bluecard_config(dev_link_t *link);
-void bluecard_release(u_long arg);
+void bluecard_release(dev_link_t *link);
int bluecard_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "bluecard_cs";
@@ -838,9 +838,6 @@
link = &info->link;
link->priv = info;
- init_timer(&link->release);
- link->release.function = &bluecard_release;
- link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
@@ -897,9 +894,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
if (link->state & DEV_CONFIG)
- bluecard_release((u_long)link);
+ bluecard_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
@@ -1004,13 +1000,12 @@
cs_error(link->handle, last_fn, last_ret);
failed:
- bluecard_release((u_long)link);
+ bluecard_release(link);
}
-void bluecard_release(u_long arg)
+void bluecard_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
bluecard_info_t *info = link->priv;
if (link->state & DEV_PRESENT)
@@ -1036,7 +1031,7 @@
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
bluecard_close(info);
- mod_timer(&link->release, jiffies + HZ / 20);
+ bluecard_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
--- 1.12/drivers/bluetooth/bt3c_cs.c Wed Apr 30 00:46:16 2003
+++ edited/drivers/bluetooth/bt3c_cs.c Thu Jul 24 01:21:11 2003
@@ -30,7 +30,6 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
-#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
@@ -94,7 +93,7 @@
void bt3c_config(dev_link_t *link);
-void bt3c_release(u_long arg);
+void bt3c_release(dev_link_t *link);
int bt3c_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "bt3c_cs";
@@ -585,9 +584,6 @@
link = &info->link;
link->priv = info;
- init_timer(&link->release);
- link->release.function = &bt3c_release;
- link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
@@ -644,10 +640,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
-
if (link->state & DEV_CONFIG)
- bt3c_release((u_long)link);
+ bt3c_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
@@ -790,13 +784,12 @@
cs_error(link->handle, last_fn, last_ret);
failed:
- bt3c_release((u_long)link);
+ bt3c_release(link);
}
-void bt3c_release(u_long arg)
+void bt3c_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
bt3c_info_t *info = link->priv;
if (link->state & DEV_PRESENT)
@@ -822,7 +815,7 @@
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
bt3c_close(info);
- mod_timer(&link->release, jiffies + HZ / 20);
+ bt3c_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
--- 1.7/drivers/bluetooth/btuart_cs.c Wed Apr 30 00:46:16 2003
+++ edited/drivers/bluetooth/btuart_cs.c Thu Jul 24 01:22:00 2003
@@ -28,7 +28,6 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
-#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
@@ -92,7 +91,7 @@
void btuart_config(dev_link_t *link);
-void btuart_release(u_long arg);
+void btuart_release(dev_link_t *link);
int btuart_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "btuart_cs";
@@ -592,9 +591,6 @@
link = &info->link;
link->priv = info;
- init_timer(&link->release);
- link->release.function = &btuart_release;
- link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
@@ -651,9 +647,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
if (link->state & DEV_CONFIG)
- btuart_release((u_long)link);
+ btuart_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
@@ -797,13 +792,12 @@
cs_error(link->handle, last_fn, last_ret);
failed:
- btuart_release((u_long) link);
+ btuart_release(link);
}
-void btuart_release(u_long arg)
+void btuart_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
btuart_info_t *info = link->priv;
if (link->state & DEV_PRESENT)
@@ -829,7 +823,7 @@
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
btuart_close(info);
- mod_timer(&link->release, jiffies + HZ / 20);
+ btuart_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
--- 1.10/drivers/bluetooth/dtl1_cs.c Wed Apr 30 00:46:18 2003
+++ edited/drivers/bluetooth/dtl1_cs.c Thu Jul 24 01:23:03 2003
@@ -28,7 +28,6 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/sched.h>
-#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
@@ -95,7 +94,7 @@
void dtl1_config(dev_link_t *link);
-void dtl1_release(u_long arg);
+void dtl1_release(dev_link_t *link);
int dtl1_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "dtl1_cs";
@@ -571,9 +570,6 @@
link = &info->link;
link->priv = info;
- init_timer(&link->release);
- link->release.function = &dtl1_release;
- link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
@@ -630,9 +626,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
if (link->state & DEV_CONFIG)
- dtl1_release((u_long)link);
+ dtl1_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
@@ -749,13 +744,12 @@
cs_error(link->handle, last_fn, last_ret);
failed:
- dtl1_release((u_long)link);
+ dtl1_release(link);
}
-void dtl1_release(u_long arg)
+void dtl1_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
dtl1_info_t *info = link->priv;
if (link->state & DEV_PRESENT)
@@ -781,7 +775,7 @@
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
dtl1_close(info);
- mod_timer(&link->release, jiffies + HZ / 20);
+ dtl1_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
--- 1.11/drivers/ide/legacy/ide-cs.c Mon Jun 23 11:18:12 2003
+++ edited/drivers/ide/legacy/ide-cs.c Thu Jul 24 01:24:45 2003
@@ -92,7 +92,7 @@
int hd;
} ide_info_t;
-static void ide_release(u_long arg);
+static void ide_release(dev_link_t *);
static int ide_event(event_t event, int priority,
event_callback_args_t *args);
@@ -126,9 +126,6 @@
memset(info, 0, sizeof(*info));
link = &info->link; link->priv = info;
- init_timer(&link->release);
- link->release.function = &ide_release;
- link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->io.IOAddrLines = 3;
@@ -187,9 +184,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
if (link->state & DEV_CONFIG)
- ide_release((u_long)link);
+ ide_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
@@ -383,7 +379,7 @@
cs_failed:
cs_error(link->handle, last_fn, last_ret);
failed:
- ide_release((u_long)link);
+ ide_release(link);
link->state &= ~DEV_CONFIG_PENDING;
} /* ide_config */
@@ -396,9 +392,8 @@
======================================================================*/
-void ide_release(u_long arg)
+void ide_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
ide_info_t *info = link->priv;
DEBUG(0, "ide_release(0x%p)\n", link);
@@ -446,7 +441,7 @@
case CS_EVENT_CARD_REMOVAL:
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG)
- mod_timer(&link->release, jiffies + HZ/20);
+ ide_release(link);
break;
case CS_EVENT_CARD_INSERTION:
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
--- 1.9/drivers/isdn/hardware/avm/avm_cs.c Wed Jun 4 18:26:28 2003
+++ edited/drivers/isdn/hardware/avm/avm_cs.c Thu Jul 24 01:30:28 2003
@@ -16,7 +16,6 @@
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/string.h>
-#include <linux/timer.h>
#include <linux/tty.h>
#include <linux/serial.h>
#include <linux/major.h>
@@ -64,7 +63,7 @@
*/
static void avmcs_config(dev_link_t *link);
-static void avmcs_release(u_long arg);
+static void avmcs_release(dev_link_t *link);
static int avmcs_event(event_t event, int priority,
event_callback_args_t *args);
@@ -142,8 +141,6 @@
if (!link)
goto err;
memset(link, 0, sizeof(struct dev_link_t));
- link->release.function = &avmcs_release;
- link->release.data = (u_long)link;
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 16;
@@ -403,7 +400,7 @@
link->state &= ~DEV_CONFIG_PENDING;
/* If any step failed, release any partially configured state */
if (i != 0) {
- avmcs_release((u_long)link);
+ avmcs_release(link);
return;
}
@@ -417,7 +414,7 @@
if ((i = (*addcard)(link->io.BasePort1, link->irq.AssignedIRQ)) < 0) {
printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n",
dev->node.dev_name, link->io.BasePort1, link->irq.AssignedIRQ);
- avmcs_release((u_long)link);
+ avmcs_release(link);
return;
}
dev->node.minor = i;
@@ -432,10 +429,8 @@
======================================================================*/
-static void avmcs_release(u_long arg)
+static void avmcs_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
-
/*
If the device is currently in use, we won't release until it
is actually closed.
@@ -483,10 +478,8 @@
switch (event) {
case CS_EVENT_CARD_REMOVAL:
link->state &= ~DEV_PRESENT;
- if (link->state & DEV_CONFIG) {
- link->release.expires = jiffies + (HZ/20);
- add_timer(&link->release);
- }
+ if (link->state & DEV_CONFIG)
+ avmcs_release(link);
break;
case CS_EVENT_CARD_INSERTION:
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -531,7 +524,7 @@
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
- avmcs_release((u_long)dev_list);
+ avmcs_release(dev_list);
avmcs_detach(dev_list);
}
}
--- 1.6/drivers/isdn/hisax/avma1_cs.c Wed Jun 4 18:26:28 2003
+++ edited/drivers/isdn/hisax/avma1_cs.c Thu Jul 24 01:29:07 2003
@@ -18,7 +18,6 @@
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/string.h>
-#include <linux/timer.h>
#include <asm/io.h>
#include <asm/system.h>
@@ -76,7 +75,7 @@
*/
static void avma1cs_config(dev_link_t *link);
-static void avma1cs_release(u_long arg);
+static void avma1cs_release(dev_link_t *link);
static int avma1cs_event(event_t event, int priority,
event_callback_args_t *args);
@@ -156,8 +155,6 @@
if (!link)
return NULL;
memset(link, 0, sizeof(struct dev_link_t));
- link->release.function = &avma1cs_release;
- link->release.data = (u_long)link;
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 16;
@@ -407,7 +404,7 @@
link->state &= ~DEV_CONFIG_PENDING;
/* If any step failed, release any partially configured state */
if (i != 0) {
- avma1cs_release((u_long)link);
+ avma1cs_release(link);
return;
}
@@ -435,9 +432,8 @@
======================================================================*/
-static void avma1cs_release(u_long arg)
+static void avma1cs_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
local_info_t *local = link->priv;
DEBUG(0, "avma1cs_release(0x%p)\n", link);
@@ -494,10 +490,8 @@
switch (event) {
case CS_EVENT_CARD_REMOVAL:
link->state &= ~DEV_PRESENT;
- if (link->state & DEV_CONFIG) {
- link->release.expires = jiffies + HZ/20;
- add_timer(&link->release);
- }
+ if (link->state & DEV_CONFIG)
+ avma1cs_release(link);
break;
case CS_EVENT_CARD_INSERTION:
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -542,7 +536,7 @@
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
- avma1cs_release((u_long)dev_list);
+ avma1cs_release(dev_list);
avma1cs_detach(dev_list);
}
}
--- 1.7/drivers/isdn/hisax/elsa_cs.c Wed Jun 4 18:26:28 2003
+++ edited/drivers/isdn/hisax/elsa_cs.c Thu Jul 24 01:28:00 2003
@@ -107,7 +107,7 @@
*/
static void elsa_cs_config(dev_link_t *link);
-static void elsa_cs_release(u_long arg);
+static void elsa_cs_release(dev_link_t *link);
static int elsa_cs_event(event_t event, int priority,
event_callback_args_t *args);
@@ -198,10 +198,6 @@
memset(local, 0, sizeof(local_info_t));
link = &local->link; link->priv = local;
- /* Initialize the dev_link_t structure */
- link->release.function = &elsa_cs_release;
- link->release.data = (u_long)link;
-
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID|IRQ_SHARE_ID;
@@ -272,9 +268,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
if (link->state & DEV_CONFIG)
- elsa_cs_release((u_long)link);
+ elsa_cs_release(link);
/*
If the device is currently configured and active, we won't
@@ -431,7 +426,7 @@
return;
cs_failed:
cs_error(link->handle, last_fn, i);
- elsa_cs_release((u_long)link);
+ elsa_cs_release(link);
} /* elsa_cs_config */
/*======================================================================
@@ -442,9 +437,8 @@
======================================================================*/
-static void elsa_cs_release(u_long arg)
+static void elsa_cs_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
DEBUG(0, "elsa_cs_release(0x%p)\n", link);
@@ -503,7 +497,7 @@
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
((local_info_t*)link->priv)->busy = 1;
- mod_timer(&link->release, jiffies + HZ/20);
+ elsa_cs_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
--- 1.10/drivers/isdn/hisax/sedlbauer_cs.c Wed Jun 4 18:26:28 2003
+++ edited/drivers/isdn/hisax/sedlbauer_cs.c Thu Jul 24 01:29:02 2003
@@ -107,7 +107,7 @@
*/
static void sedlbauer_config(dev_link_t *link);
-static void sedlbauer_release(u_long arg);
+static void sedlbauer_release(dev_link_t *link);
static int sedlbauer_event(event_t event, int priority,
event_callback_args_t *args);
@@ -205,10 +205,6 @@
memset(local, 0, sizeof(local_info_t));
link = &local->link; link->priv = local;
- /* Initialize the dev_link_t structure */
- link->release.function = &sedlbauer_release;
- link->release.data = (u_long)link;
-
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
@@ -523,7 +519,7 @@
cs_failed:
cs_error(link->handle, last_fn, last_ret);
- sedlbauer_release((u_long)link);
+ sedlbauer_release(link);
} /* sedlbauer_config */
@@ -535,10 +531,8 @@
======================================================================*/
-static void sedlbauer_release(u_long arg)
+static void sedlbauer_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
-
DEBUG(0, "sedlbauer_release(0x%p)\n", link);
/*
@@ -601,7 +595,7 @@
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
((local_info_t *)link->priv)->stop = 1;
- mod_timer(&link->release, jiffies + HZ/20);
+ sedlbauer_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
@@ -655,7 +649,7 @@
while (dev_list != NULL) {
del_timer(&dev_list->release);
if (dev_list->state & DEV_CONFIG)
- sedlbauer_release((u_long)dev_list);
+ sedlbauer_release(dev_list);
sedlbauer_detach(dev_list);
}
}
--- 1.8/drivers/parport/parport_cs.c Sun May 18 22:57:40 2003
+++ edited/drivers/parport/parport_cs.c Thu Jul 24 01:31:58 2003
@@ -96,7 +96,7 @@
static dev_link_t *parport_attach(void);
static void parport_detach(dev_link_t *);
static void parport_config(dev_link_t *link);
-static void parport_cs_release(u_long arg);
+static void parport_cs_release(dev_link_t *);
static int parport_event(event_t event, int priority,
event_callback_args_t *args);
@@ -126,9 +126,6 @@
memset(info, 0, sizeof(*info));
link = &info->link; link->priv = info;
- init_timer(&link->release);
- link->release.function = &parport_cs_release;
- link->release.data = (u_long)link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
@@ -186,9 +183,8 @@
if (*linkp == NULL)
return;
- del_timer(&link->release);
if (link->state & DEV_CONFIG)
- parport_cs_release((u_long)link);
+ parport_cs_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
@@ -308,7 +304,7 @@
cs_failed:
cs_error(link->handle, last_fn, last_ret);
failed:
- parport_cs_release((u_long)link);
+ parport_cs_release(link);
link->state &= ~DEV_CONFIG_PENDING;
} /* parport_config */
@@ -321,9 +317,8 @@
======================================================================*/
-void parport_cs_release(u_long arg)
+void parport_cs_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *)arg;
parport_info_t *info = link->priv;
DEBUG(0, "parport_release(0x%p)\n", link);
@@ -366,7 +361,7 @@
case CS_EVENT_CARD_REMOVAL:
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG)
- mod_timer(&link->release, jiffies + HZ/20);
+ parport_cs_release(link);
break;
case CS_EVENT_CARD_INSERTION:
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
--- 1.5/drivers/telephony/ixj_pcmcia.c Sat Apr 26 18:16:27 2003
+++ edited/drivers/telephony/ixj_pcmcia.c Thu Jul 24 01:34:14 2003
@@ -38,7 +38,7 @@
static dev_link_t *ixj_attach(void);
static void ixj_detach(dev_link_t *);
static void ixj_config(dev_link_t * link);
-static void ixj_cs_release(u_long arg);
+static void ixj_cs_release(dev_link_t * link);
static int ixj_event(event_t event, int priority, event_callback_args_t * args);
static dev_info_t dev_info = "ixj_cs";
static dev_link_t *dev_list = NULL;
@@ -54,9 +54,6 @@
if (!link)
return NULL;
memset(link, 0, sizeof(struct dev_link_t));
- init_timer(&link->release);
- link->release.function = &ixj_cs_release;
- link->release.data = (u_long) link;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->io.IOAddrLines = 3;
@@ -97,10 +94,9 @@
break;
if (*linkp == NULL)
return;
- del_timer_sync(&link->release);
link->state &= ~DEV_RELEASE_PENDING;
if (link->state & DEV_CONFIG)
- ixj_cs_release((u_long) link);
+ ixj_cs_release(link);
if (link->handle) {
ret = CardServices(DeregisterClient, link->handle);
if (ret != CS_SUCCESS)
@@ -251,12 +247,11 @@
return;
cs_failed:
cs_error(link->handle, last_fn, last_ret);
- ixj_cs_release((u_long) link);
+ ixj_cs_release(link);
}
-static void ixj_cs_release(u_long arg)
+static void ixj_cs_release(dev_link_t *link)
{
- dev_link_t *link = (dev_link_t *) arg;
ixj_info_t *info = link->priv;
DEBUG(0, "ixj_cs_release(0x%p)\n", link);
info->ndev = 0;
@@ -274,9 +269,8 @@
case CS_EVENT_CARD_REMOVAL:
link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) {
- link->release.expires = jiffies + (HZ / 20);
link->state |= DEV_RELEASE_PENDING;
- add_timer(&link->release);
+ ixj_cs_release(link);
}
break;
case CS_EVENT_CARD_INSERTION:
More information about the linux-pcmcia
mailing list