Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Marko Kohtala and committed by
Linus Torvalds
7c9cc3be c29a75ed

+7 -7
+7 -7
drivers/parport/daisy.c
··· 344 344 PARPORT_CONTROL_STROBE, 345 345 PARPORT_CONTROL_STROBE); 346 346 udelay (1); 347 + s = parport_read_status (port); 347 348 parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); 348 349 udelay (1); 349 - s = parport_read_status (port); 350 350 parport_write_data (port, 0xff); udelay (2); 351 351 352 352 return s; ··· 395 395 case IEEE1284_MODE_EPP: 396 396 case IEEE1284_MODE_EPPSL: 397 397 case IEEE1284_MODE_EPPSWE: 398 - return (cpp_daisy (port, 0x20 + daisy) & 399 - PARPORT_STATUS_ERROR); 398 + return !(cpp_daisy (port, 0x20 + daisy) & 399 + PARPORT_STATUS_ERROR); 400 400 401 401 // For these modes we should switch to ECP mode: 402 402 case IEEE1284_MODE_ECP: 403 403 case IEEE1284_MODE_ECPRLE: 404 404 case IEEE1284_MODE_ECPSWE: 405 - return (cpp_daisy (port, 0xd0 + daisy) & 406 - PARPORT_STATUS_ERROR); 405 + return !(cpp_daisy (port, 0xd0 + daisy) & 406 + PARPORT_STATUS_ERROR); 407 407 408 408 // Nothing was told for BECP in Daisy chain specification. 409 409 // May be it's wise to use ECP? ··· 413 413 case IEEE1284_MODE_BYTE: 414 414 case IEEE1284_MODE_COMPAT: 415 415 default: 416 - return (cpp_daisy (port, 0xe0 + daisy) & 417 - PARPORT_STATUS_ERROR); 416 + return !(cpp_daisy (port, 0xe0 + daisy) & 417 + PARPORT_STATUS_ERROR); 418 418 } 419 419 } 420 420