[PATCH]USB:fix limited_power setting mistake in hub.c

"jidong xiao" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
This patch (jx001) fixes a variable assignment mistake in hub driver.
limited_power should be set to 0 if the hub is self-powered,and 1 if
the hub is bus-powered.

However, the effect of the code was exactly opposite to the spec's
statement for the Local Power Source field. The spec says, this field
is 1 meaning Local power supply lost while this field is 0 indicating
Local power supply good.(This statement is very confusing.)

So this patch switchs the 0 and 1.


Signed-off-by: Jason Xiao <[email protected]>

---

diff -purN linux-2.6.23-rc6.orig/drivers/usb/core/hub.c
linux-2.6.23-rc6/drivers/usb/core/hub.c
--- linux-2.6.23-rc6.orig/drivers/usb/core/hub.c        2007-09-13
23:26:48.000000000 -0400
+++ linux-2.6.23-rc6/drivers/usb/core/hub.c     2007-09-13
23:29:07.000000000 -0400
@@ -2699,9 +2699,9 @@ static void hub_events(void)
                                clear_hub_feature(hdev, C_HUB_LOCAL_POWER);
                                if (hubstatus & HUB_STATUS_LOCAL_POWER)
                                        /* FIXME: Is this always true? */
-                                       hub->limited_power = 0;
-                               else
                                        hub->limited_power = 1;
+                               else
+                                       hub->limited_power = 0;
                        }
                        if (hubchange & HUB_CHANGE_OVERCURRENT) {
                                dev_dbg (hub_dev, "overcurrent change\n");

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.