Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nick-nhusb]: src/sys/dev/usb Make the code match the comment wrt port po...



details:   https://anonhg.NetBSD.org/src/rev/82545f061763
branches:  nick-nhusb
changeset: 334537:82545f061763
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Oct 07 10:32:49 2016 +0000

description:
Make the code match the comment wrt port powered status

diffstat:

 sys/dev/usb/usb_subr.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 21d1445e96e7 -r 82545f061763 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Wed Oct 05 20:55:23 2016 +0000
+++ b/sys/dev/usb/usb_subr.c    Fri Oct 07 10:32:49 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.198.2.31 2016/10/05 20:55:57 skrll Exp $        */
+/*     $NetBSD: usb_subr.c,v 1.198.2.32 2016/10/07 10:32:49 skrll Exp $        */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.198.2.31 2016/10/05 20:55:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.198.2.32 2016/10/07 10:32:49 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1563,10 +1563,9 @@
                         * on 3.x, and UPS_PORT_POWER is available
                         * only on 2.0 or 1.1.
                         */
-                       else if (USB_IS_SS(dev->ud_speed) &&
-                           (s & UPS_PORT_POWER_SS))
+                       else if (sshub_p && (s & UPS_PORT_POWER_SS))
                                err = USB_PORT_POWERED;
-                       else if (s & UPS_PORT_POWER)
+                       else if (!sshub_p && (s & UPS_PORT_POWER))
                                err = USB_PORT_POWERED;
                        else
                                err = USB_PORT_DISABLED;



Home | Main Index | Thread Index | Old Index