summaryrefslogtreecommitdiff
path: root/common/cmd_ide.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/cmd_ide.c
parent620d3c9a14affca29a5c4e575e9f355c2bd4aed2 (diff)
downloadu-boot-imx-735dd97b1b20e777d059c7b389fe9d70cd3f80c7.zip
u-boot-imx-735dd97b1b20e777d059c7b389fe9d70cd3f80c7.tar.gz
u-boot-imx-735dd97b1b20e777d059c7b389fe9d70cd3f80c7.tar.bz2
[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/cmd_ide.c')
-rw-r--r--common/cmd_ide.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index a415502..ebc080c 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -31,20 +31,26 @@
#include <command.h>
#include <image.h>
#include <asm/byteorder.h>
+
#if defined(CONFIG_IDE_8xx_DIRECT) || defined(CONFIG_IDE_PCMCIA)
# include <pcmcia.h>
#endif
+
#ifdef CONFIG_8xx
# include <mpc8xx.h>
#endif
+
#ifdef CONFIG_MPC5xxx
#include <mpc5xxx.h>
#endif
+
#include <ide.h>
#include <ata.h>
+
#ifdef CONFIG_STATUS_LED
# include <status_led.h>
#endif
+
#ifndef __PPC__
#include <asm/io.h>
#ifdef __MIPS__
@@ -697,7 +703,7 @@ void ide_init (void)
block_dev_desc_t * ide_get_dev(int dev)
{
- return ((block_dev_desc_t *)&ide_dev_desc[dev]);
+ return (dev < CFG_IDE_MAXDEVICE) ? &ide_dev_desc[dev] : NULL;
}