[PATCH] Omnikey CardMan 4000 update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 14, 2005 at 02:23:14AM -0700, Andrew Morton wrote:
> Harald Welte <[email protected]> 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 <[email protected]>

--- 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 <[email protected]>          	        http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Attachment: pgpmhveqUIoeL.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux