aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/Kconfig2
-rw-r--r--drivers/ide/setup-pci.c2
-rw-r--r--include/linux/ide.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 0524f17175fd..abcabb295592 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -56,7 +56,7 @@ if IDE
56 56
57config IDE_MAX_HWIFS 57config IDE_MAX_HWIFS
58 int "Max IDE interfaces" 58 int "Max IDE interfaces"
59 depends on ALPHA || SUPERH || IA64 59 depends on ALPHA || SUPERH || IA64 || EMBEDDED
60 default 4 60 default 4
61 help 61 help
62 This is the maximum number of IDE hardware interfaces that will 62 This is the maximum number of IDE hardware interfaces that will
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index eb0945284acc..157fe93ea342 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -101,7 +101,7 @@ static ide_hwif_t *ide_match_hwif(unsigned long io_base, u8 bootable, const char
101 return hwif; /* pick an unused entry */ 101 return hwif; /* pick an unused entry */
102 } 102 }
103 } 103 }
104 for (h = 0; h < 2; ++h) { 104 for (h = 0; h < 2 && h < MAX_HWIFS; ++h) {
105 hwif = ide_hwifs + h; 105 hwif = ide_hwifs + h;
106 if (hwif->chipset == ide_unknown) 106 if (hwif->chipset == ide_unknown)
107 return hwif; /* pick an unused entry */ 107 return hwif; /* pick an unused entry */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 11608cd03d4c..bdb2733208c5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -251,7 +251,8 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
251 251
252#include <asm/ide.h> 252#include <asm/ide.h>
253 253
254#ifndef MAX_HWIFS 254#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
255#undef MAX_HWIFS
255#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS 256#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
256#endif 257#endif
257 258