lkml.org 
[lkml]   [2004]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPATCH: (as339) Interpret down_trylock() result code correctly in usb.c
Greg:

As Andrew Morton has already spotted, I messed up the interpretation of
the result codes from various _trylock() routines. I didn't notice that
down_trylock() and down_read_trylock() use opposite conventions for
indicating success! This patch fixes the incorrect interpretation of
down_trylock(). That error may well be responsible for some of the
problems cropping up recently with OHCI controllers. Please apply.

Alan Stern



Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

===== drivers/usb/core/usb.c 1.281 vs edited =====
--- 1.281/drivers/usb/core/usb.c Wed Jun 30 09:44:26 2004
+++ edited/drivers/usb/core/usb.c Tue Jul 6 12:00:32 2004
@@ -871,7 +871,7 @@
{
if (!down_read_trylock(&usb_all_devices_rwsem))
return 0;
- if (!down_trylock(&udev->serialize)) {
+ if (down_trylock(&udev->serialize)) {
up_read(&usb_all_devices_rwsem);
return 0;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.053 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site