aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/speakup/speakup_decpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/speakup/speakup_decpc.c')
-rw-r--r--drivers/staging/speakup/speakup_decpc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c
index 67678d8888c2..7c9c432e48d9 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -260,6 +260,7 @@ static void dt_sendcmd(u_int cmd)
static int dt_waitbit(int bit)
{
int timeout = 100;
+
while (--timeout > 0) {
if ((dt_getstatus() & bit) == bit)
return 1;
@@ -271,6 +272,7 @@ static int dt_waitbit(int bit)
static int dt_wait_dma(void)
{
int timeout = 100, state = dma_state;
+
if (!dt_waitbit(STAT_dma_ready))
return 0;
while (--timeout > 0) {
@@ -285,6 +287,7 @@ static int dt_wait_dma(void)
static int dt_ctrl(u_int cmd)
{
int timeout = 10;
+
if (!dt_waitbit(STAT_cmd_ready))
return -1;
outb_p(0, speakup_info.port_tts+2);
@@ -304,6 +307,7 @@ static int dt_ctrl(u_int cmd)
static void synth_flush(struct spk_synth *synth)
{
int timeout = 10;
+
if (is_flushing)
return;
is_flushing = 4;
@@ -346,6 +350,7 @@ static int dt_sendchar(char ch)
static int testkernel(void)
{
int status = 0;
+
if (dt_getstatus() == 0xffff) {
status = -1;
goto oops;
@@ -415,7 +420,7 @@ static void do_catch_up(struct spk_synth *synth)
else if (ch <= SPACE) {
if (!in_escape && strchr(",.!?;:", last))
dt_sendchar(PROCSPEECH);
- if (jiffies >= jiff_max) {
+ if (time_after_eq(jiffies, jiff_max)) {
if (!in_escape)
dt_sendchar(PROCSPEECH);
spin_lock_irqsave(&speakup_info.spinlock, flags);
@@ -437,6 +442,7 @@ static void do_catch_up(struct spk_synth *synth)
static const char *synth_immediate(struct spk_synth *synth, const char *buf)
{
u_char ch;
+
while ((ch = *buf)) {
if (ch == '\n')
ch = PROCSPEECH;
@@ -450,6 +456,7 @@ static const char *synth_immediate(struct spk_synth *synth, const char *buf)
static int synth_probe(struct spk_synth *synth)
{
int i = 0, failed = 0;
+
pr_info("Probing for %s.\n", synth->long_name);
for (i = 0; synth_portlist[i]; i++) {
if (synth_request_region(synth_portlist[i], SYNTH_IO_EXTENT)) {