From owner-p4-projects@FreeBSD.ORG Tue Dec 16 15:55:23 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4BAB91065678; Tue, 16 Dec 2008 15:55:23 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FBF4106564A for ; Tue, 16 Dec 2008 15:55:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F0B608FC22 for ; Tue, 16 Dec 2008 15:55:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBGFtM6H081932 for ; Tue, 16 Dec 2008 15:55:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBGFtMHB081930 for perforce@freebsd.org; Tue, 16 Dec 2008 15:55:22 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 16 Dec 2008 15:55:22 GMT Message-Id: <200812161555.mBGFtMHB081930@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 154796 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 15:55:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=154796 Change 154796 by hselasky@hselasky_laptop001 on 2008/12/16 15:55:15 Bugfix for USB devices without any configuration. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#37 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#37 (text+ko) ==== @@ -1588,11 +1588,19 @@ err = usb2_set_config_index(udev, config_index); sx_unlock(udev->default_sx + 1); if (err) { - DPRINTFN(0, "Failure selecting " - "configuration index %u: %s, port %u, addr %u\n", - config_index, usb2_errstr(err), udev->port_no, - udev->address); - + if (udev->ddesc.bNumConfigurations != 0) { + DPRINTFN(0, "Failure selecting " + "configuration index %u: %s, port %u, " + "addr %u (ignored)\n", + config_index, usb2_errstr(err), udev->port_no, + udev->address); + } + /* + * Some USB devices does not have any + * configurations. Ignore any set config + * failures! + */ + err = 0; } else if (config_quirk) { /* user quirk selects configuration index */ } else if ((config_index + 1) < udev->ddesc.bNumConfigurations) {