From patchwork Sun Apr 3 07:18:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 605532 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qd63B5rRpz9t3Z for ; Sun, 3 Apr 2016 17:20:38 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2394A768D; Sun, 3 Apr 2016 09:19:46 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J541mjf-JFaV; Sun, 3 Apr 2016 09:19:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1450BA769D; Sun, 3 Apr 2016 09:19:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 32386A769A for ; Sun, 3 Apr 2016 09:19:29 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hTwQ4Y2o1htl for ; Sun, 3 Apr 2016 09:19:29 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id 06AC5A7669 for ; Sun, 3 Apr 2016 09:19:02 +0200 (CEST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25482C00126D; Sun, 3 Apr 2016 07:19:01 +0000 (UTC) Received: from localhost.localdomain.com (vpn1-6-10.ams2.redhat.com [10.36.6.10]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u337Ivjq030854; Sun, 3 Apr 2016 03:18:58 -0400 From: Hans de Goede To: Simon Glass , Marek Vasut Date: Sun, 3 Apr 2016 09:18:53 +0200 Message-Id: <1459667933-2702-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] usb: kbd: Do not deregister usbkbd twice when using dm X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The dm usb_kbd_remove function() will deregister the usb keyboard for us on a "usb reset" / "usb stop" so there is no need to manually call usb_kbd_deregister() in the dm case. This commit removes usb_kbd_deregister() in the dm case fixing the following "usb reset" errors: usb_kbd_remove: warning, ret=-6 device_remove: Device 'usb_kbd' failed to remove, but children are gone Signed-off-by: Hans de Goede --- cmd/usb.c | 2 +- common/usb_kbd.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/usb.c b/cmd/usb.c index 719f6f2..f1a7deb 100644 --- a/cmd/usb.c +++ b/cmd/usb.c @@ -545,7 +545,7 @@ static int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) static int do_usb_stop_keyboard(int force) { -#ifdef CONFIG_USB_KEYBOARD +#if !defined CONFIG_DM_USB && defined CONFIG_USB_KEYBOARD if (usb_kbd_deregister(force) != 0) { printf("USB not stopped: usbkbd still using USB\n"); return 1; diff --git a/common/usb_kbd.c b/common/usb_kbd.c index d84865f..97f79f8 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -566,7 +566,6 @@ int drv_usb_kbd_init(void) /* No USB Keyboard found */ return -1; } -#endif /* Deregister the keyboard. */ int usb_kbd_deregister(int force) @@ -599,6 +598,8 @@ int usb_kbd_deregister(int force) #endif } +#endif + #ifdef CONFIG_DM_USB static int usb_kbd_probe(struct udevice *dev)