From patchwork Tue Sep 6 13:17:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 75513 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp544770qgf; Tue, 6 Sep 2016 06:18:54 -0700 (PDT) X-Received: by 10.28.139.75 with SMTP id n72mr19798091wmd.104.1473167928764; Tue, 06 Sep 2016 06:18:48 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id xw9si27644728wjc.295.2016.09.06.06.18.48; Tue, 06 Sep 2016 06:18:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 02393B3827; Tue, 6 Sep 2016 15:18:48 +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 iPSJxTbyM0_e; Tue, 6 Sep 2016 15:18:47 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B2B04BF90; Tue, 6 Sep 2016 15:17:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 474804BA35 for ; Tue, 6 Sep 2016 15:16:19 +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 yeKz5tFOoX9F for ; Tue, 6 Sep 2016 15:16:19 +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 conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by theia.denx.de (Postfix) with ESMTPS id 455F04B9F9 for ; Tue, 6 Sep 2016 15:16:17 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id u86DFbit013304; Tue, 6 Sep 2016 22:15:43 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com u86DFbit013304 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1473167743; bh=jCHb3altcvycYm4n7WBQ7wv7pVximAfbjwfBL+bOhN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XyUOvFBYutlJ8+weCXQLAGhM0PIyBbZGuIuiCqIaXtr9AUXvPpdn+dqo0xA+o8izg uy6l89fuV7is9INjxHdca891Y1wOpSi9ft6kQRDjUXrbDlxVlXGUBR51IWjPBTYRqD efhynaN5kDvfAT2nnifBMqgp8AkRnrESjV1ZJSyK3hctrE+InEnJP9aGu46GG+uGJI CEW4b20TarZzEzSRD7K8lm3dYfSF0W21R0JGItoGiWLI+f/XVVBcOQSz0SZCGoagrY 1lwcPA0EOiWPHfLuFv1LCp5Z2OHLedjbTruaqtii/mhXDLYeCUBB06F2VKziuff3Cz z2qoYjLvNg+qg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 6 Sep 2016 22:17:35 +0900 Message-Id: <1473167860-27465-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1473167860-27465-1-git-send-email-yamada.masahiro@socionext.com> References: <1473167860-27465-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Stephen Warren , Vagrant Cascadian , Stefan Roese Subject: [U-Boot] [PATCH v3 4/8] usb: squash lines for immediate return 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" This makes functions much simpler. Signed-off-by: Masahiro Yamada --- Changes in v3: None common/usb.c | 20 +++++++------------- common/usb_kbd.c | 5 +---- common/usb_storage.c | 9 +++------ drivers/usb/host/xhci-fsl.c | 7 +------ 4 files changed, 12 insertions(+), 29 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/common/usb.c b/common/usb.c index b3ba487..15e1e4c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -557,12 +557,10 @@ int usb_clear_halt(struct usb_device *dev, int pipe) static int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char index, void *buf, int size) { - int res; - res = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), - USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, - (type << 8) + index, 0, - buf, size, USB_CNTL_TIMEOUT); - return res; + return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), + USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, + (type << 8) + index, 0, buf, size, + USB_CNTL_TIMEOUT); } /********************************************************************** @@ -612,14 +610,10 @@ int usb_get_configuration_no(struct usb_device *dev, int cfgno, */ static int usb_set_address(struct usb_device *dev) { - int res; - debug("set address %d\n", dev->devnum); - res = usb_control_msg(dev, usb_snddefctrl(dev), - USB_REQ_SET_ADDRESS, 0, - (dev->devnum), 0, - NULL, 0, USB_CNTL_TIMEOUT); - return res; + + return usb_control_msg(dev, usb_snddefctrl(dev), USB_REQ_SET_ADDRESS, + 0, (dev->devnum), 0, NULL, 0, USB_CNTL_TIMEOUT); } /******************************************************************** diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 97f79f8..a9872a6 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -605,11 +605,8 @@ int usb_kbd_deregister(int force) static int usb_kbd_probe(struct udevice *dev) { struct usb_device *udev = dev_get_parent_priv(dev); - int ret; - - ret = probe_usb_keyboard(udev); - return ret; + return probe_usb_keyboard(udev); } static int usb_kbd_remove(struct udevice *dev) diff --git a/common/usb_storage.c b/common/usb_storage.c index 7e6e52d..0345aa2 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -708,13 +708,10 @@ static int usb_stor_CBI_get_status(ccb *srb, struct us_data *us) /* clear a stall on an endpoint - special for BBB devices */ static int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt) { - int result; - /* ENDPOINT_HALT = 0, so set value to 0 */ - result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), - USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, - 0, endpt, NULL, 0, USB_CNTL_TIMEOUT * 5); - return result; + return usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), + USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, 0, + endpt, NULL, 0, USB_CNTL_TIMEOUT * 5); } static int usb_stor_BBB_transport(ccb *srb, struct us_data *us) diff --git a/drivers/usb/host/xhci-fsl.c b/drivers/usb/host/xhci-fsl.c index bdcd4f1..6ff450c 100644 --- a/drivers/usb/host/xhci-fsl.c +++ b/drivers/usb/host/xhci-fsl.c @@ -129,15 +129,10 @@ static int xhci_fsl_probe(struct udevice *dev) static int xhci_fsl_remove(struct udevice *dev) { struct xhci_fsl_priv *priv = dev_get_priv(dev); - int ret; fsl_xhci_core_exit(&priv->ctx); - ret = xhci_deregister(dev); - if (ret) - return ret; - - return 0; + return xhci_deregister(dev); } static const struct udevice_id xhci_usb_ids[] = {