summaryrefslogtreecommitdiff
path: root/linux/dev
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-12 14:18:55 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-12 14:20:36 +0100
commitdccf8be4b40ede12941ff347781fbff9330b2280 (patch)
treec6866751cce9e7c6fffbc822a0fa2e0274be2db5 /linux/dev
parent57694037a02dda29bd678dc3b8531bd437682ba7 (diff)
Pass ide and hd kernel options to ide driver
* linux/dev/drivers/block/genhd.c: Include <linux/hdreg.h> and <alloca.h> (device_setup): Look for ide and hd options, and call ide_setup with them. * linux/src/drivers/block/ide.c (ide_setup) [MACH]: Parse hd[0-7] instead of hd[a-h].
Diffstat (limited to 'linux/dev')
-rw-r--r--linux/dev/drivers/block/genhd.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/linux/dev/drivers/block/genhd.c b/linux/dev/drivers/block/genhd.c
index 95b499b..3a86138 100644
--- a/linux/dev/drivers/block/genhd.c
+++ b/linux/dev/drivers/block/genhd.c
@@ -27,6 +27,8 @@
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h>
#endif
+#include <linux/hdreg.h>
+#include <alloca.h>
#include <asm/system.h>
@@ -768,12 +770,36 @@ static void setup_dev(struct gendisk *dev)
void device_setup(void)
{
extern void console_map_init(void);
+ extern char *kernel_cmdline;
+ char *c, *param, *white;
struct gendisk *p;
int nr=0;
#ifdef MACH
linux_intr_pri = SPL6;
#endif
+ for (c = kernel_cmdline; c; )
+ {
+ param = strstr(c, " ide");
+ if (!param)
+ param = strstr(c, " hd");
+ if (!param)
+ break;
+ if (param) {
+ param++;
+ white = strchr(param, ' ');
+ if (!white) {
+ ide_setup(param);
+ c = NULL;
+ } else {
+ char *word = alloca(white - param + 1);
+ strncpy(word, param, white - param);
+ word[white-param] = '\0';
+ ide_setup(word);
+ c = white + 1;
+ }
+ }
+ }
#ifndef MACH
chr_dev_init();
#endif