ChangeSet 1.1752, 2004/05/18 16:56:06-07:00, greg@kroah.com

Some more misc wait_ms() conversions to use msleep()


 drivers/macintosh/therm_pm72.c      |   17 +++++------------
 drivers/net/irda/stir4200.c         |    5 +++--
 drivers/video/aty/radeon_base.c     |    2 +-
 drivers/video/aty/radeon_i2c.c      |   16 ++++++++--------
 drivers/video/aty/radeonfb.h        |    9 ---------
 sound/oss/dmasound/dac3550a.c       |    5 +++--
 sound/oss/dmasound/dmasound.h       |    6 ------
 sound/oss/dmasound/dmasound_awacs.c |   30 +++++++++++++++---------------
 sound/oss/trident.c                 |    2 +-
 sound/pci/au88x0/au88x0_game.c      |    3 ++-
 10 files changed, 38 insertions(+), 57 deletions(-)


diff -Nru a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
--- a/drivers/macintosh/therm_pm72.c	Tue May 18 17:04:23 2004
+++ b/drivers/macintosh/therm_pm72.c	Tue May 18 17:04:23 2004
@@ -146,13 +146,6 @@
 	.detach_adapter	= therm_pm72_detach,
 };
 
-
-static inline void wait_ms(unsigned int ms)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(1 + (ms * HZ + 999) / 1000);
-}
-
 /*
  * Utility function to create an i2c_client structure and
  * attach it to one of u3 adapters
@@ -251,7 +244,7 @@
 		if (rc <= 0)
 			goto error;
 		/* Wait for convertion */
-		wait_ms(1);
+		msleep(1);
 		/* Switch to data register */
 		buf[0] = 4;
 		rc = i2c_master_send(state->monitor, buf, 1);
@@ -269,7 +262,7 @@
 			printk(KERN_ERR "therm_pm72: Error reading ADC !\n");
 			return -1;
 		}
-		wait_ms(10);
+		msleep(10);
 	}
 }
 
@@ -283,7 +276,7 @@
 		nw = i2c_master_send(fcu, buf, 1);
 		if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
 			break;
-		wait_ms(10);
+		msleep(10);
 		++tries;
 	}
 	if (nw <= 0) {
@@ -295,7 +288,7 @@
 		nr = i2c_master_recv(fcu, buf, nb);
 		if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
 			break;
-		wait_ms(10);
+		msleep(10);
 		++tries;
 	}
 	if (nr <= 0)
@@ -316,7 +309,7 @@
 		nw = i2c_master_send(fcu, buf, nb);
 		if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
 			break;
-		wait_ms(10);
+		msleep(10);
 		++tries;
 	}
 	if (nw < 0)
diff -Nru a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
--- a/drivers/net/irda/stir4200.c	Tue May 18 17:04:23 2004
+++ b/drivers/net/irda/stir4200.c	Tue May 18 17:04:23 2004
@@ -48,6 +48,7 @@
 #include <linux/netdevice.h>
 #include <linux/suspend.h>
 #include <linux/slab.h>
+#include <linux/delay.h>
 #include <linux/usb.h>
 #include <linux/crc32.h>
 #include <net/irda/irda.h>
@@ -652,7 +653,7 @@
 			return 0;
 
 		/* estimate transfer time for remaining chars */
-		wait_ms((count * 8000) / stir->speed);
+		msleep((count * 8000) / stir->speed);
 	}
 			
 	err = write_reg(stir, REG_FIFOCTL, FIFOCTL_CLR);
@@ -810,7 +811,7 @@
 					info("%s: receive usb submit failed",
 					     stir->netdev->name);
 				stir->receiving = 0;
-				wait_ms(10);
+				msleep(10);
 				continue;
 			}
 		}
diff -Nru a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
--- a/drivers/video/aty/radeon_base.c	Tue May 18 17:04:23 2004
+++ b/drivers/video/aty/radeon_base.c	Tue May 18 17:04:23 2004
@@ -1184,7 +1184,7 @@
 		~(PPLL_RESET | PPLL_SLEEP | PPLL_ATOMIC_UPDATE_EN | PPLL_VGA_ATOMIC_UPDATE_EN));
 
 	/* We may want some locking ... oh well */
-       	wait_ms(5);
+       	msleep(5);
 
 	/* Switch back VCLK source to PPLL */
 	OUTPLLP(VCLK_ECP_CNTL, VCLK_SRC_SEL_PPLLCLK, ~VCLK_SRC_SEL_MASK);
diff -Nru a/drivers/video/aty/radeon_i2c.c b/drivers/video/aty/radeon_i2c.c
--- a/drivers/video/aty/radeon_i2c.c	Tue May 18 17:04:23 2004
+++ b/drivers/video/aty/radeon_i2c.c	Tue May 18 17:04:23 2004
@@ -189,12 +189,12 @@
 		 */
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(13);
+		msleep(13);
 
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
 		for (j = 0; j < 5; j++) {
-			wait_ms(10);
+			msleep(10);
 			if (INREG(reg) & VGA_DDC_CLK_INPUT)
 				break;
 		}
@@ -203,13 +203,13 @@
 
 		OUTREG(reg, INREG(reg) | VGA_DDC_DATA_OUT_EN);
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		OUTREG(reg, INREG(reg) | VGA_DDC_CLK_OUT_EN);
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 
 		/* Do the real work */
 		edid = radeon_do_probe_i2c_edid(&rinfo->i2c[conn-1]);
@@ -217,19 +217,19 @@
 		OUTREG(reg, INREG(reg) | 
 				(VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
 		for (j = 0; j < 10; j++) {
-			wait_ms(10);
+			msleep(10);
 			if (INREG(reg) & VGA_DDC_CLK_INPUT)
 				break;
 		}
 
 		OUTREG(reg, INREG(reg) & ~(VGA_DDC_DATA_OUT_EN));
 		(void)INREG(reg);
-		wait_ms(15);
+		msleep(15);
 		OUTREG(reg, INREG(reg) |
 				(VGA_DDC_DATA_OUT_EN | VGA_DDC_CLK_OUT_EN));
 		(void)INREG(reg);
diff -Nru a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
--- a/drivers/video/aty/radeonfb.h	Tue May 18 17:04:23 2004
+++ b/drivers/video/aty/radeonfb.h	Tue May 18 17:04:23 2004
@@ -438,15 +438,6 @@
 /*
  * Inline utilities
  */
-
-static inline void wait_ms(unsigned long ms)
-{
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout((ms * HZ + 999) / 1000);
-}
-
-
-
 static inline int round_div(int num, int den)
 {
         return (num + (den / 2)) / den;
diff -Nru a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c
--- a/sound/oss/dmasound/dac3550a.c	Tue May 18 17:04:23 2004
+++ b/sound/oss/dmasound/dac3550a.c	Tue May 18 17:04:23 2004
@@ -9,6 +9,7 @@
 
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/delay.h>
 #include <linux/proc_fs.h>
 #include <linux/ioport.h>
 #include <linux/sysctl.h>
@@ -97,14 +98,14 @@
 	/* Do a short sleep, just to make sure I2C bus is awake and paying
 	 * attention to us
 	 */
-	wait_ms(20);
+	msleep(20);
 	/* Write the sample rate reg the value it needs */
 	i2c_smbus_write_byte_data(daca_client, 1, 8);
 	daca_set_volume(cur_left_vol >> 5, cur_right_vol >> 5);
 	/* Another short delay, just to make sure the other I2C bus writes
 	 * have taken...
 	 */
-	wait_ms(20);
+	msleep(20);
 	/* Write the global config reg - invert right power amp,
 	 * DAC on, use 5-volt mode */
 	i2c_smbus_write_byte_data(daca_client, 3, 0x45);
diff -Nru a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
--- a/sound/oss/dmasound/dmasound.h	Tue May 18 17:04:24 2004
+++ b/sound/oss/dmasound/dmasound.h	Tue May 18 17:04:24 2004
@@ -267,12 +267,6 @@
 */
 #define BS_VAL 1
 
-static inline void wait_ms(unsigned int ms)
-{
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(1 + ms * HZ / 1000);
-}
-
 #define SW_INPUT_VOLUME_SCALE	4
 #define SW_INPUT_VOLUME_DEFAULT	(128 / SW_INPUT_VOLUME_SCALE)
 
diff -Nru a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
--- a/sound/oss/dmasound/dmasound_awacs.c	Tue May 18 17:04:23 2004
+++ b/sound/oss/dmasound/dmasound_awacs.c	Tue May 18 17:04:23 2004
@@ -457,9 +457,9 @@
 			&gpio_headphone_detect_pol);
 
 	write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-	wait_ms(100);
+	msleep(100);
 	write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
-	wait_ms(100);
+	msleep(100);
   	if (gpio_headphone_irq) {
 		if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",0) < 0) {
     			printk(KERN_ERR "tumbler: Can't request headphone interrupt\n");
@@ -653,7 +653,7 @@
 	    machine_is_compatible("PowerBook3,2")) && awacs) {
 		awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
 		awacs_write(MASK_ADDR1 | awacs_reg[1]);
-		wait_ms(200);
+		msleep(200);
 	}
 	if (awacs)
 		free_irq(awacs_irq, 0);
@@ -775,10 +775,10 @@
 	/* Sorry for the horrible delays... I hope to get that improved
 	 * by making the whole PM process asynchronous in a future version
 	 */
-	wait_ms(750);
+	msleep(750);
 	awacs_reg[1] |= MASK_CMUTE | MASK_AMUTE;
 	awacs_write(awacs_reg[1] | MASK_RECALIBRATE | MASK_ADDR1);
-	wait_ms(1000);
+	msleep(1000);
 	awacs_write(awacs_reg[1] | MASK_ADDR1);
 }
 
@@ -1405,9 +1405,9 @@
 
 	if (awacs_revision == AWACS_SCREAMER) {
 		awacs_write(awacs_reg[5] + MASK_ADDR5);
-		wait_ms(100);
+		msleep(100);
 		awacs_write(awacs_reg[6] + MASK_ADDR6);
-		wait_ms(2);
+		msleep(2);
 		awacs_write(awacs_reg[1] + MASK_ADDR1);
 		awacs_write(awacs_reg[7] + MASK_ADDR7);
 	}
@@ -1479,7 +1479,7 @@
 		    machine_is_compatible("PowerBook3,2")) && awacs) {
 			awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
 			awacs_write(MASK_ADDR1 | awacs_reg[1]);
-			wait_ms(200);
+			msleep(200);
 		}
 		break;
 	case PBOOK_WAKE:
@@ -1487,12 +1487,12 @@
 		pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, awacs_node, 0, 1);
 		if ((machine_is_compatible("PowerBook3,1") ||
 		    machine_is_compatible("PowerBook3,2")) && awacs) {
-			wait_ms(100);
+			msleep(100);
 			awacs_reg[1] &= ~(MASK_PAROUT0 | MASK_PAROUT1);
 			awacs_write(MASK_ADDR1 | awacs_reg[1]);
-			wait_ms(300);
+			msleep(300);
 		} else
-			wait_ms(1000);
+			msleep(1000);
  		/* restore settings */
 		switch (awacs_revision) {
 			case AWACS_TUMBLER:
@@ -1500,14 +1500,14 @@
 				write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
 				write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
 				write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-				wait_ms(100);
+				msleep(100);
 				write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
-				wait_ms(150);
+				msleep(150);
 				tas_leave_sleep(); /* Stub for now */
 				headphone_intr(0,0,0);
 				break;
 			case AWACS_DACA:
-				wait_ms(10); /* Check this !!! */
+				msleep(10); /* Check this !!! */
 				daca_leave_sleep();
 				break ;		/* dont know how yet */
 			case AWACS_BURGUNDY:
@@ -2432,7 +2432,7 @@
 	 * release the memory.
 	 */
 
-	wait_ms(100) ; /* give it a (small) chance to act */
+	msleep(100) ; /* give it a (small) chance to act */
 
 	/* apply the sledgehammer approach - just stop it now */
 
diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c
--- a/sound/oss/trident.c	Tue May 18 17:04:24 2004
+++ b/sound/oss/trident.c	Tue May 18 17:04:24 2004
@@ -4294,7 +4294,7 @@
 	switch (mode) {
 	case GAMEPORT_MODE_COOKED:
 		outb(0x80, TRID_REG(card, T4D_GAME_CR));
-		wait_ms(20);
+		msleep(20);
 		return 0;
 	case GAMEPORT_MODE_RAW:
 		outb(0x00, TRID_REG(card, T4D_GAME_CR));
diff -Nru a/sound/pci/au88x0/au88x0_game.c b/sound/pci/au88x0/au88x0_game.c
--- a/sound/pci/au88x0/au88x0_game.c	Tue May 18 17:04:23 2004
+++ b/sound/pci/au88x0/au88x0_game.c	Tue May 18 17:04:23 2004
@@ -32,6 +32,7 @@
 
 #include <sound/driver.h>
 #include <linux/time.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <sound/core.h>
 #include "au88x0.h"
@@ -81,7 +82,7 @@
 		hwwrite(vortex->mmio, VORTEX_CTRL2,
 			hwread(vortex->mmio,
 			       VORTEX_CTRL2) | CTRL2_GAME_ADCMODE);
-		wait_ms(VORTEX_GAME_DWAIT);
+		msleep(VORTEX_GAME_DWAIT);
 		return 0;
 	case GAMEPORT_MODE_RAW:
 		hwwrite(vortex->mmio, VORTEX_CTRL2,
