diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-09-06 22:17:35 +0900 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-09-23 17:53:48 -0400 |
commit | 8319aeb1dad46c4b6d35ea16a5697ff8160dd4d1 (patch) | |
tree | dca6d03512e98c730cd7b6851d039e31d4cef84e /common/usb.c | |
parent | 4052734273668e5f8fbe6ae8c85dd043514a38eb (diff) | |
download | u-boot-imx-8319aeb1dad46c4b6d35ea16a5697ff8160dd4d1.zip u-boot-imx-8319aeb1dad46c4b6d35ea16a5697ff8160dd4d1.tar.gz u-boot-imx-8319aeb1dad46c4b6d35ea16a5697ff8160dd4d1.tar.bz2 |
usb: squash lines for immediate return
This makes functions much simpler.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'common/usb.c')
-rw-r--r-- | common/usb.c | 20 |
1 files changed, 7 insertions, 13 deletions
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); } /******************************************************************** |