diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
commit | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch) | |
tree | 40b1cb534496a7f1ca0f5c314a523c69f1fee464 /drivers/block/ide-probe.c | |
parent | 7206675c40394c78a90e74812bbdbf8cf3cca1be (diff) |
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'drivers/block/ide-probe.c')
-rw-r--r-- | drivers/block/ide-probe.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/block/ide-probe.c b/drivers/block/ide-probe.c index 7ddbede36..76e10c08f 100644 --- a/drivers/block/ide-probe.c +++ b/drivers/block/ide-probe.c @@ -1,5 +1,5 @@ /* - * linux/drivers/block/ide-probe.c Version 1.0 Oct 31, 1996 + * linux/drivers/block/ide-probe.c Version 1.01 Jan 26, 1997 * * Copyright (C) 1994-1996 Linus Torvalds & authors (see below) */ @@ -36,7 +36,8 @@ * code is still sprinkled about. Think of it as a major evolution, with * inspiration from lots of linux users, esp. hamish@zot.apana.org.au * - * Version 1.0 move drive probing code from ide.c to ide-probe.c + * Version 1.00 move drive probing code from ide.c to ide-probe.c + * Version 1.01 fix compilation problem for m68k */ #undef REALLY_SLOW_IO /* most systems can safely undef this */ @@ -494,9 +495,7 @@ static void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) static int init_irq (ide_hwif_t *hwif) { unsigned long flags; -#if MAX_HWIFS > 1 unsigned int index; -#endif /* MAX_HWIFS > 1 */ ide_hwgroup_t *hwgroup; ide_hwif_t *match = NULL; @@ -535,14 +534,11 @@ static int init_irq (ide_hwif_t *hwif) hwgroup = match->hwgroup; } else { hwgroup = kmalloc(sizeof(ide_hwgroup_t), GFP_KERNEL); - hwgroup->hwif = hwgroup->next_hwif = hwif->next = hwif; + memset(hwgroup, 0, sizeof(ide_hwgroup_t)); + hwgroup->hwif = hwif->next = hwif; hwgroup->rq = NULL; hwgroup->handler = NULL; - if (hwif->drives[0].present) - hwgroup->drive = &hwif->drives[0]; - else - hwgroup->drive = &hwif->drives[1]; - hwgroup->poll_timeout = 0; + hwgroup->drive = NULL; init_timer(&hwgroup->timer); hwgroup->timer.function = &ide_timer_expiry; hwgroup->timer.data = (unsigned long) hwgroup; @@ -567,6 +563,16 @@ static int init_irq (ide_hwif_t *hwif) hwif->next = hwgroup->hwif->next; hwgroup->hwif->next = hwif; + for (index = 0; index < MAX_DRIVES; ++index) { + ide_drive_t *drive = &hwif->drives[index]; + if (!drive->present) + continue; + if (!hwgroup->drive) + hwgroup->drive = drive; + drive->next = hwgroup->drive->next; + hwgroup->drive->next = drive; + } + hwgroup->hwif = HWIF(hwgroup->drive); restore_flags(flags); /* safe now that hwif->hwgroup is set up */ #ifndef __mc68000__ @@ -671,7 +677,9 @@ static int hwif_init (int h) (void) unregister_blkdev (hwif->major, hwif->name); } else { init_gendisk(hwif); + blk_dev[hwif->major].data = hwif; blk_dev[hwif->major].request_fn = rfn; + blk_dev[hwif->major].queue = ide_get_queue; read_ahead[hwif->major] = 8; /* (4kB) */ hwif->present = 1; /* success */ } |