rem: exit: __sdcard_dounmount(chn,ret); return SDCARD_ERROR_NOCARD;
add: ret = SDCARD_ERROR_WRONGDEVICE; return ret;
context: s32 SDCARD_Mount(s32 chn,SDCCallback detach_cb){	s32 ret;	sdcard_block *card = NULL;	if(chn<EXI_CHANNEL_0 || chn>=EXI_CHANNEL_2) return SDCARD_ERROR_FATALERROR;	card = &sdcard_map[chn];#ifdef _SDCARD_DEBUG	printf("SDCARD_Mount(): mounting card.\n");#endif	if(card->result==SDCARD_ERROR_BUSY) return SDCARD_ERROR_BUSY;	while((ret=EXI_ProbeEx(chn))==0);	if(ret!=1) return SDCARD_ERROR_NOCARD;		ret = SDCARD_ERROR_BUSY;	if(card->attached || !(EXI_GetState(chn)&EXI_FLAG_ATTACH)) {		card->result = SDCARD_ERROR_BUSY;		card->ext_cb = detach_cb;		card->api_cb = __sdcard_defaultapicallback;		card->exi_cb = NULL;				if(!card->attached) {			if(EXI_Attach(chn,__sdcard_exthandler)==0) {				card->result = SDCARD_ERROR_NOCARD;				return SDCARD_ERROR_NOCARD;			}		}		card->attached = 1;		card->mount_step = 0;		if((ret=SDCARD_Reset(chn))!=0) {			ret = SDCARD_ERROR_IOERROR;			goto exit;		}		return SDCARD_ERROR_READY;	}exit:	__sdcard_dounmount(chn,ret);	return SDCARD_ERROR_NOCARD;}