summaryrefslogtreecommitdiff
path: root/drivers/parport/daisy.c
diff options
context:
space:
mode:
authorMarko Kohtala <marko.kohtala@gmail.com>2006-01-06 00:19:46 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:57 -0800
commit7c9cc3be1094b267a2da2e0016cbd6ced663da6d (patch)
treefa3cbbf6a904cbaf474a4ed04e30b5c8253a3f9a /drivers/parport/daisy.c
parentc29a75ed0d94fae64b59345ea96e52424ae9c6a2 (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/daisy.c')
-rw-r--r--drivers/parport/daisy.c14
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)
PARPORT_CONTROL_STROBE,
PARPORT_CONTROL_STROBE);
udelay (1);
+ s = parport_read_status (port);
parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
udelay (1);
- s = parport_read_status (port);
parport_write_data (port, 0xff); udelay (2);
return s;
@@ -395,15 +395,15 @@ int parport_daisy_select (struct parport *port, int daisy, int mode)
case IEEE1284_MODE_EPP:
case IEEE1284_MODE_EPPSL:
case IEEE1284_MODE_EPPSWE:
- return (cpp_daisy (port, 0x20 + daisy) &
- PARPORT_STATUS_ERROR);
+ return !(cpp_daisy (port, 0x20 + daisy) &
+ PARPORT_STATUS_ERROR);
// For these modes we should switch to ECP mode:
case IEEE1284_MODE_ECP:
case IEEE1284_MODE_ECPRLE:
case IEEE1284_MODE_ECPSWE:
- return (cpp_daisy (port, 0xd0 + daisy) &
- PARPORT_STATUS_ERROR);
+ return !(cpp_daisy (port, 0xd0 + daisy) &
+ PARPORT_STATUS_ERROR);
// Nothing was told for BECP in Daisy chain specification.
// May be it's wise to use ECP?
@@ -413,8 +413,8 @@ int parport_daisy_select (struct parport *port, int daisy, int mode)
case IEEE1284_MODE_BYTE:
case IEEE1284_MODE_COMPAT:
default:
- return (cpp_daisy (port, 0xe0 + daisy) &
- PARPORT_STATUS_ERROR);
+ return !(cpp_daisy (port, 0xe0 + daisy) &
+ PARPORT_STATUS_ERROR);
}
}