From 735dd97b1b20e777d059c7b389fe9d70cd3f80c7 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Tue, 20 Feb 2007 09:04:34 +0100 Subject: [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 --- common/usb_storage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/usb_storage.c') diff --git a/common/usb_storage.c b/common/usb_storage.c index 06ea99b2f1..b4b7914089 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -56,6 +56,7 @@ #if (CONFIG_COMMANDS & CFG_CMD_USB) +#include #include #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; } -- cgit v1.2.1