1: uhs_sbit32_t Usbh_Stor_Unmount(
PUSER_DRV pDrv)
2: {
3: uhs_ubit8_t i;
4:
5: API_REPORT_MILESTONE( USBSTOR_CHKPOINTS_API_UNMOUNT );
6:
7:
8:
if( pStorClassDriver == NULL ) {
9: API_REPORT_SUMMARY( USBSTOR_LOG_SYS_SYSTEM_ERROR );
10:
return USBSTOR_SYS_SYSTEM_ERROR;
11: }
12:
13:
14:
if( pDrv == NULL ) {
15: API_REPORT_SUMMARY( USBSTOR_LOG_API_PARAM_ERROR );
16:
return Usbh_Stor_SetLastError( NULL,
USBSTOR_API_PARAM_ERROR );
17: }
18:
19:
20:
for( i = 0; i < (uhs_ubit8_t) numof(stDriveTable); i++ ) {
21:
if( stDriveTable[i].pUserDrv == pDrv ) {
22:
23: stDriveTable[i].pUserDrv = NULL;
24:
return USBSTOR_SUCCESS;
25: }
26: }
27:
28:
29: API_REPORT_SUMMARY( USBSTOR_LOG_API_UNMOUNT_DRIVE );
30:
return Usbh_Stor_SetLastError( NULL,
USBSTOR_API_UNMOUNT_DRIVE );
31: }