[PATCH] Omnikey CardMan 4000 update

From: Harald Welte
Date: Sun Sep 18 2005 - 16:22:39 EST


On Wed, Sep 14, 2005 at 02:23:14AM -0700, Andrew Morton wrote:
> Harald Welte <laforge@xxxxxxxxxxxx> wrote:
> >
> > Add new Omnikey Cardman 4000 smartcard reader driver
>
> - All the open-coded mdelays() are wrong:
>
> #define T_10MSEC msecs_to_jiffies(10)
> ...
> mdelay(T_10MSEC);
>
> mdelay() already takes a jiffies argument.
>
> - terminate_monitor() should use del_timer_sync().
>

Plaease see the patch below (against -rc1-mm1):

[CM4000] CardMan 4000 Driver Update

* use milliseconds as parameter for mdelay, not jiffies
* clarify that dev->mdelay parameter is in jiffies
* use del_timer_sync() instead of del_timer()

Signed-off-by: Harald Welte <laforge@xxxxxxxxxxxx>

--- a/drivers/char/pcmcia/cm4000_cs.c 2005-09-18 18:56:29.000000000 +0200
+++ b/drivers/char/pcmcia/cm4000_cs.c 2005-09-18 21:39:31.000000000 +0200
@@ -131,7 +131,7 @@
unsigned char cwarn; /* slow down warning */
unsigned char flags0; /* cardman IO-flags 0 */
unsigned char flags1; /* cardman IO-flags 1 */
- unsigned int mdelay; /* variable monitor speeds */
+ unsigned int mdelay; /* variable monitor speeds, in jiffies */

unsigned int baudv; /* baud value for speed */
unsigned char ta1;
@@ -564,7 +564,7 @@
DEBUGP(5, dev, "NumRecBytes is valid\n");
break;
}
- mdelay(T_10MSEC);
+ mdelay(10);
}
if (i == 100) {
DEBUGP(5, dev, "Timeout waiting for NumRecBytes getting "
@@ -580,7 +580,7 @@
DEBUGP(2, dev, "NumRecBytes = %i\n", num_bytes_read);
break;
}
- mdelay(T_10MSEC);
+ mdelay(10);
}

/* check whether it is a short PTS reply? */
@@ -678,7 +678,7 @@
msleep(25);

DEBUGP(5, dev, "Delete timer\n");
- del_timer(&dev->timer);
+ del_timer_sync(&dev->timer);
#ifdef PCMCIA_DEBUG
dev->monitor_running = 0;
#endif
--
- Harald Welte <laforge@xxxxxxxxxxxx> http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)

Attachment: pgp00000.pgp
Description: PGP signature