Commit e1a929af authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Input: remove wait_ms() in place of using msleep()

parent a8e9fcec
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h>
#include <linux/gameport.h> #include <linux/gameport.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pnp.h> #include <linux/pnp.h>
...@@ -103,7 +104,7 @@ static void ns558_isa_probe(int io) ...@@ -103,7 +104,7 @@ static void ns558_isa_probe(int io)
i = 0; i = 0;
goto out; goto out;
} }
wait_ms(3); msleep(3);
/* /*
* After some time (4ms) the axes shouldn't change anymore. * After some time (4ms) the axes shouldn't change anymore.
*/ */
...@@ -129,7 +130,7 @@ static void ns558_isa_probe(int io) ...@@ -129,7 +130,7 @@ static void ns558_isa_probe(int io)
outb(0xff, io & (-1 << i)); outb(0xff, io & (-1 << i));
for (j = b = 0; j < 1000; j++) for (j = b = 0; j < 1000; j++)
if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++; if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++;
wait_ms(3); msleep(3);
if (b > 300) { /* We allow 30% difference */ if (b > 300) { /* We allow 30% difference */
release_region(io & (-1 << i), (1 << i)); release_region(io & (-1 << i), (1 << i));
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h>
#include <linux/gameport.h> #include <linux/gameport.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
...@@ -93,7 +94,7 @@ static int vortex_open(struct gameport *gameport, int mode) ...@@ -93,7 +94,7 @@ static int vortex_open(struct gameport *gameport, int mode)
switch (mode) { switch (mode) {
case GAMEPORT_MODE_COOKED: case GAMEPORT_MODE_COOKED:
writeb(0x40, vortex->io + VORTEX_GCR); writeb(0x40, vortex->io + VORTEX_GCR);
wait_ms(VORTEX_DATA_WAIT); msleep(VORTEX_DATA_WAIT);
return 0; return 0;
case GAMEPORT_MODE_RAW: case GAMEPORT_MODE_RAW:
writeb(0x00, vortex->io + VORTEX_GCR); writeb(0x00, vortex->io + VORTEX_GCR);
......
...@@ -321,7 +321,7 @@ static void adi_init_digital(struct gameport *gameport) ...@@ -321,7 +321,7 @@ static void adi_init_digital(struct gameport *gameport)
for (i = 0; seq[i]; i++) { for (i = 0; seq[i]; i++) {
gameport_trigger(gameport); gameport_trigger(gameport);
if (seq[i] > 0) wait_ms(seq[i]); if (seq[i] > 0) msleep(seq[i]);
if (seq[i] < 0) mdelay(-seq[i]); if (seq[i] < 0) mdelay(-seq[i]);
} }
} }
...@@ -513,9 +513,9 @@ static void adi_connect(struct gameport *gameport, struct gameport_dev *dev) ...@@ -513,9 +513,9 @@ static void adi_connect(struct gameport *gameport, struct gameport_dev *dev)
return; return;
} }
wait_ms(ADI_INIT_DELAY); msleep(ADI_INIT_DELAY);
if (adi_read(port)) { if (adi_read(port)) {
wait_ms(ADI_DATA_DELAY); msleep(ADI_DATA_DELAY);
adi_read(port); adi_read(port);
} }
......
...@@ -603,18 +603,18 @@ static int analog_init_port(struct gameport *gameport, struct gameport_dev *dev, ...@@ -603,18 +603,18 @@ static int analog_init_port(struct gameport *gameport, struct gameport_dev *dev,
gameport_trigger(gameport); gameport_trigger(gameport);
t = gameport_read(gameport); t = gameport_read(gameport);
wait_ms(ANALOG_MAX_TIME); msleep(ANALOG_MAX_TIME);
port->mask = (gameport_read(gameport) ^ t) & t & 0xf; port->mask = (gameport_read(gameport) ^ t) & t & 0xf;
port->fuzz = (port->speed * ANALOG_FUZZ_MAGIC) / port->loop / 1000 + ANALOG_FUZZ_BITS; port->fuzz = (port->speed * ANALOG_FUZZ_MAGIC) / port->loop / 1000 + ANALOG_FUZZ_BITS;
for (i = 0; i < ANALOG_INIT_RETRIES; i++) { for (i = 0; i < ANALOG_INIT_RETRIES; i++) {
if (!analog_cooked_read(port)) break; if (!analog_cooked_read(port)) break;
wait_ms(ANALOG_MAX_TIME); msleep(ANALOG_MAX_TIME);
} }
u = v = 0; u = v = 0;
wait_ms(ANALOG_MAX_TIME); msleep(ANALOG_MAX_TIME);
t = gameport_time(gameport, ANALOG_MAX_TIME * 1000); t = gameport_time(gameport, ANALOG_MAX_TIME * 1000);
gameport_trigger(gameport); gameport_trigger(gameport);
while ((gameport_read(port->gameport) & port->mask) && (u < t)) u++; while ((gameport_read(port->gameport) & port->mask) && (u < t)) u++;
......
...@@ -260,11 +260,11 @@ static void gf2k_connect(struct gameport *gameport, struct gameport_dev *dev) ...@@ -260,11 +260,11 @@ static void gf2k_connect(struct gameport *gameport, struct gameport_dev *dev)
gf2k_trigger_seq(gameport, gf2k_seq_reset); gf2k_trigger_seq(gameport, gf2k_seq_reset);
wait_ms(GF2K_TIMEOUT); msleep(GF2K_TIMEOUT);
gf2k_trigger_seq(gameport, gf2k_seq_digital); gf2k_trigger_seq(gameport, gf2k_seq_digital);
wait_ms(GF2K_TIMEOUT); msleep(GF2K_TIMEOUT);
if (gf2k_read_packet(gameport, GF2K_LENGTH, data) < 12) if (gf2k_read_packet(gameport, GF2K_LENGTH, data) < 12)
goto fail2; goto fail2;
......
...@@ -118,10 +118,4 @@ static __inline__ int gameport_time(struct gameport *gameport, int time) ...@@ -118,10 +118,4 @@ static __inline__ int gameport_time(struct gameport *gameport, int time)
return (time * gameport->speed) / 1000; return (time * gameport->speed) / 1000;
} }
static __inline__ void wait_ms(unsigned int ms)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1 + ms * HZ / 1000);
}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment