diff options
author | Marko Kohtala <marko.kohtala@gmail.com> | 2006-01-06 03:19:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:57 -0500 |
commit | 7c9cc3be1094b267a2da2e0016cbd6ced663da6d (patch) | |
tree | fa3cbbf6a904cbaf474a4ed04e30b5c8253a3f9a /drivers/parport | |
parent | c29a75ed0d94fae64b59345ea96e52424ae9c6a2 (diff) |
[PATCH] parport: parport_daisy_select return value fix
parport_daisy_select returned wrong status that is read at wrong time
during daisy command execution.
Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/daisy.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/parport/daisy.c b/drivers/parport/daisy.c index 37dc17933518..9109a40fc8c0 100644 --- a/drivers/parport/daisy.c +++ b/drivers/parport/daisy.c | |||
@@ -344,9 +344,9 @@ static int cpp_daisy (struct parport *port, int cmd) | |||
344 | PARPORT_CONTROL_STROBE, | 344 | PARPORT_CONTROL_STROBE, |
345 | PARPORT_CONTROL_STROBE); | 345 | PARPORT_CONTROL_STROBE); |
346 | udelay (1); | 346 | udelay (1); |
347 | s = parport_read_status (port); | ||
347 | parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); | 348 | parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); |
348 | udelay (1); | 349 | udelay (1); |
349 | s = parport_read_status (port); | ||
350 | parport_write_data (port, 0xff); udelay (2); | 350 | parport_write_data (port, 0xff); udelay (2); |
351 | 351 | ||
352 | return s; | 352 | return s; |
@@ -395,15 +395,15 @@ int parport_daisy_select (struct parport *port, int daisy, int mode) | |||
395 | case IEEE1284_MODE_EPP: | 395 | case IEEE1284_MODE_EPP: |
396 | case IEEE1284_MODE_EPPSL: | 396 | case IEEE1284_MODE_EPPSL: |
397 | case IEEE1284_MODE_EPPSWE: | 397 | case IEEE1284_MODE_EPPSWE: |
398 | return (cpp_daisy (port, 0x20 + daisy) & | 398 | return !(cpp_daisy (port, 0x20 + daisy) & |
399 | PARPORT_STATUS_ERROR); | 399 | PARPORT_STATUS_ERROR); |
400 | 400 | ||
401 | // For these modes we should switch to ECP mode: | 401 | // For these modes we should switch to ECP mode: |
402 | case IEEE1284_MODE_ECP: | 402 | case IEEE1284_MODE_ECP: |
403 | case IEEE1284_MODE_ECPRLE: | 403 | case IEEE1284_MODE_ECPRLE: |
404 | case IEEE1284_MODE_ECPSWE: | 404 | case IEEE1284_MODE_ECPSWE: |
405 | return (cpp_daisy (port, 0xd0 + daisy) & | 405 | return !(cpp_daisy (port, 0xd0 + daisy) & |
406 | PARPORT_STATUS_ERROR); | 406 | PARPORT_STATUS_ERROR); |
407 | 407 | ||
408 | // Nothing was told for BECP in Daisy chain specification. | 408 | // Nothing was told for BECP in Daisy chain specification. |
409 | // May be it's wise to use ECP? | 409 | // May be it's wise to use ECP? |
@@ -413,8 +413,8 @@ int parport_daisy_select (struct parport *port, int daisy, int mode) | |||
413 | case IEEE1284_MODE_BYTE: | 413 | case IEEE1284_MODE_BYTE: |
414 | case IEEE1284_MODE_COMPAT: | 414 | case IEEE1284_MODE_COMPAT: |
415 | default: | 415 | default: |
416 | return (cpp_daisy (port, 0xe0 + daisy) & | 416 | return !(cpp_daisy (port, 0xe0 + daisy) & |
417 | PARPORT_STATUS_ERROR); | 417 | PARPORT_STATUS_ERROR); |
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||