diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-09 02:42:02 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-01-09 02:42:02 +0000 |
commit | 5bdca5bec60da89395a77402c0eea7d0c627eb98 (patch) | |
tree | 9b0839fc935801461b9f80f56ba981f7a9744082 /nuttx/drivers/usbhost/usbhost_storage.c | |
parent | e29ce8c2602d6d15a9ff92707ed1c7fabeb59cbe (diff) | |
download | px4-nuttx-5bdca5bec60da89395a77402c0eea7d0c627eb98.tar.gz px4-nuttx-5bdca5bec60da89395a77402c0eea7d0c627eb98.tar.bz2 px4-nuttx-5bdca5bec60da89395a77402c0eea7d0c627eb98.zip |
Remove some unnecessary tests
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3235 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_storage.c')
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_storage.c | 60 |
1 files changed, 10 insertions, 50 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index 7aee9d2ea..c13e32bb8 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -660,25 +660,17 @@ static inline int usbhost_maxlunreq(FAR struct usbhost_state_s *priv) FAR struct usb_ctrlreq_s *req = (FAR struct usb_ctrlreq_s *)priv->tdbuffer; DEBUGASSERT(priv && priv->tdbuffer); - /* Make sure that the device is still connected. */ - - if (!priv->disconnected) - { - /* Request maximum logical unit number. NOTE: On an IN transaction, The - * req and buffer pointers passed to DRVR_CTRLIN may refer to the same - * allocated memory. - */ - - uvdbg("Request maximum logical unit number\n"); - memset(req, 0, sizeof(struct usb_ctrlreq_s)); - req->type = USB_DIR_IN|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE; - req->req = USBSTRG_REQ_GETMAXLUN; - usbhost_putle16(req->len, 1); - return DRVR_CTRLIN(priv->drvr, req, priv->tdbuffer); - } + /* Request maximum logical unit number. NOTE: On an IN transaction, The + * req and buffer pointers passed to DRVR_CTRLIN may refer to the same + * allocated memory. + */ - udbg("ERROR: No longer connected\n"); - return -ENODEV; + uvdbg("Request maximum logical unit number\n"); + memset(req, 0, sizeof(struct usb_ctrlreq_s)); + req->type = USB_DIR_IN|USB_REQ_TYPE_CLASS|USB_REQ_RECIPIENT_INTERFACE; + req->req = USBSTRG_REQ_GETMAXLUN; + usbhost_putle16(req->len, 1); + return DRVR_CTRLIN(priv->drvr, req, priv->tdbuffer); } static inline int usbhost_testunitready(FAR struct usbhost_state_s *priv) @@ -686,14 +678,6 @@ static inline int usbhost_testunitready(FAR struct usbhost_state_s *priv) FAR struct usbstrg_cbw_s *cbw; int result; - /* Make sure that the device is still connected */ - - if (priv->disconnected) - { - udbg("ERROR: No longer connected\n"); - return -ENODEV; - } - /* Initialize a CBW (re-using the allocated transfer buffer) */ cbw = usbhost_cbwalloc(priv); @@ -727,14 +711,6 @@ static inline int usbhost_requestsense(FAR struct usbhost_state_s *priv) FAR struct usbstrg_cbw_s *cbw; int result; - /* Make sure that the device is still connected */ - - if (priv->disconnected) - { - udbg("ERROR: No longer connected\n"); - return -ENODEV; - } - /* Initialize a CBW (re-using the allocated transfer buffer) */ cbw = usbhost_cbwalloc(priv); @@ -777,14 +753,6 @@ static inline int usbhost_readcapacity(FAR struct usbhost_state_s *priv) FAR struct scsiresp_readcapacity10_s *resp; int result; - /* Make sure that the device is still connected */ - - if (priv->disconnected) - { - udbg("ERROR: No longer connected\n"); - return -ENODEV; - } - /* Initialize a CBW (re-using the allocated transfer buffer) */ cbw = usbhost_cbwalloc(priv); @@ -833,14 +801,6 @@ static inline int usbhost_inquiry(FAR struct usbhost_state_s *priv) FAR struct scsiresp_inquiry_s *resp; int result; - /* Make sure that the device is still connected */ - - if (priv->disconnected) - { - udbg("ERROR: No longer connected\n"); - return -ENODEV; - } - /* Initialize a CBW (re-using the allocated transfer buffer) */ cbw = usbhost_cbwalloc(priv); |