diff options
| author | [email protected] <[email protected]> | 2012-11-26 03:39:00 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2012-11-26 03:39:00 +0000 |
| commit | d86196e5282069b4125b8cf1f9db0167517180f1 (patch) | |
| tree | e51df5c8780e77e540aeb5a7252242deff6ed72e /components/drivers | |
| parent | 62447b2cd84b529f7dbf6712c29d7ac4ff0c1e12 (diff) | |
output log when no disk
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2450 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/usb/usbdevice/class/mstorage.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index 58870dbd86..5d9242f964 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -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;
|
