summaryrefslogtreecommitdiff
path: root/common/usb_storage.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2007-02-20 09:04:34 +0100
committerStefan Roese <sr@denx.de>2007-02-20 09:04:34 +0100
commit735dd97b1b20e777d059c7b389fe9d70cd3f80c7 (patch)
treeeb62a0abe8bdea88c563380c302a88fa64eff151 /common/usb_storage.c
parent620d3c9a14affca29a5c4e575e9f355c2bd4aed2 (diff)
[PATCH 1_4] Merge common get_dev() routines for block devices
Each of the filesystem drivers duplicate the get_dev routine. This change merges them into a single function in part.c Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'common/usb_storage.c')
-rw-r--r--common/usb_storage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 06ea99b2f1a..b4b79140899 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -56,6 +56,7 @@
#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#include <part.h>
#include <usb.h>
#ifdef CONFIG_USB_STORAGE
@@ -174,7 +175,7 @@ void uhci_show_temp_int_td(void);
block_dev_desc_t *usb_stor_get_dev(int index)
{
- return &usb_dev_desc[index];
+ return (index < USB_MAX_STOR_DEV) ? &usb_dev_desc[index] : NULL;
}