From 0320e6efdcfd4bf43cf1c56627910e2cf6bbaecd Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 12 May 2011 12:58:56 +0000 Subject: Fix USB host error handling logic git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3593 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/drivers/usbhost/usbhost_storage.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'nuttx/drivers/usbhost/usbhost_storage.c') diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c index 118758a60a..7a41cde657 100644 --- a/nuttx/drivers/usbhost/usbhost_storage.c +++ b/nuttx/drivers/usbhost/usbhost_storage.c @@ -937,6 +937,10 @@ static void usbhost_destroy(FAR void *arg) * On success, zero (OK) is returned. On a failure, a negated errno value is * returned indicating the nature of the failure * + * NOTE that the class instance remains valid upon return with a failure. It is + * the responsibility of the higher level enumeration logic to call + * CLASS_DISCONNECTED to free up the class driver resources. + * * Assumptions: * This function will *not* be called from an interrupt handler. * @@ -1308,14 +1312,6 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv) } } - /* Disconnect on any errors detected during volume initialization */ - - if (ret != OK) - { - udbg("ERROR! Aborting: %d\n", ret); - usbhost_destroy(priv); - } - return ret; } -- cgit v1.2.3