提交 403fae78 编写于 作者: J jidong xiao 提交者: Greg Kroah-Hartman

USB: fix limited_power setting mistake in hub.c

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: NJason Xiao <jidong.xiao@gmail.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 ed6590a8
......@@ -2818,9 +2818,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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册