output log when no disk

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2450 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
sc943313837@gmail.com 2012-11-26 03:39:00 +00:00
parent 62447b2cd8
commit d86196e528
1 changed files with 6 additions and 3 deletions

View File

@ -487,13 +487,16 @@ static rt_err_t _class_run(udevice_t device)
disk = rt_device_find(RT_USB_MSTORAGE_DISK_NAME);
if(disk == RT_NULL)
return RT_ERROR;
{
rt_kprintf("no disk named %s\n", RT_USB_MSTORAGE_DISK_NAME);
return -RT_ERROR;
}
if(rt_device_control(disk, RT_DEVICE_CTRL_BLK_GETGEOME, (void*)&geometry) != RT_EOK)
return RT_ERROR;
return -RT_ERROR;
buffer = (rt_uint8_t*)rt_malloc(geometry.bytes_per_sector);
if(buffer == RT_NULL)
return RT_ERROR;
return -RT_ENOMEM;
dcd_ep_read(device->dcd, ep_out, ep_out->buffer, SIZEOF_CBW);
return RT_EOK;