lkml.org 
[lkml]   [2004]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 9/9] USB usbfs: drop pointless racy check
Date
The check of interface->dev.driver requires a lock to be taken
to protect against driver binding changes. But in fact I think it
is better just to drop the test. The result is that the caller is
required to claim an interface before changing the altsetting,
which is consistent with the other routines that operate on
interfaces.

devio.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
--- a/drivers/usb/core/devio.c Wed Apr 14 12:18:37 2004
+++ b/drivers/usb/core/devio.c Wed Apr 14 12:18:37 2004
@@ -747,10 +747,8 @@
if ((ret = findintfif(ps->dev, setintf.interface)) < 0)
return ret;
interface = ps->dev->actconfig->interface[ret];
- if (interface->dev.driver) {
- if ((ret = checkintf(ps, ret)))
- return ret;
- }
+ if ((ret = checkintf(ps, ret)))
+ return ret;
if (usb_set_interface(ps->dev, setintf.interface, setintf.altsetting))
return -EINVAL;
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:02    [W:0.034 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site