diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-25 12:22:12 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:22 -0600 |
commit | 1d5827a12ebd20d64b972111b846cb1ca87ff82e (patch) | |
tree | a32180a581d8d5103ec390ab88d90c72d05de96e | |
parent | 2e17c87ebb4cb46c51e7d893705b69b95ee05cab (diff) | |
download | u-boot-imx-1d5827a12ebd20d64b972111b846cb1ca87ff82e.zip u-boot-imx-1d5827a12ebd20d64b972111b846cb1ca87ff82e.tar.gz u-boot-imx-1d5827a12ebd20d64b972111b846cb1ca87ff82e.tar.bz2 |
dm: usb: Fix type problems in usb_stor_get_info()
This function assumes that unsigned long is 32-bits wide, but it is not
on 64-bit machines. Use the correct type, and add a few debug() lines also.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
-rw-r--r-- | common/usb_storage.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c index 62527a9..5108d23 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -1191,6 +1191,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum, iface->desc.bInterfaceClass != USB_CLASS_MASS_STORAGE || iface->desc.bInterfaceSubClass < US_SC_MIN || iface->desc.bInterfaceSubClass > US_SC_MAX) { + debug("Not mass storage\n"); /* if it's not a mass storage, we go no further */ return 0; } @@ -1317,8 +1318,10 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, pccb->lun = dev_desc->lun; debug(" address %d\n", dev_desc->target); - if (usb_inquiry(pccb, ss)) + if (usb_inquiry(pccb, ss)) { + debug("%s: usb_inquiry() failed\n", __func__); return -1; + } perq = usb_stor_buf[0]; modi = usb_stor_buf[1]; @@ -1328,6 +1331,7 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, * they would not respond to test_unit_ready . */ if (((perq & 0x1f) == 0x1f) || ((perq & 0x1f) == 0x0d)) { + debug("%s: unknown/unsupported device\n", __func__); return 0; } if ((modi&0x80) == 0x80) { |