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/cmd_ide.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'common/cmd_ide.c') diff --git a/common/cmd_ide.c b/common/cmd_ide.c index a4155029a7..ebc080c72a 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -31,20 +31,26 @@ #include #include #include + #if defined(CONFIG_IDE_8xx_DIRECT) || defined(CONFIG_IDE_PCMCIA) # include #endif + #ifdef CONFIG_8xx # include #endif + #ifdef CONFIG_MPC5xxx #include #endif + #include #include + #ifdef CONFIG_STATUS_LED # include #endif + #ifndef __PPC__ #include #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; } -- cgit v1.2.3