aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/cris/ide-cris.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-27 21:35:55 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-27 21:35:55 +0100
commite816056210941e9886e447e331b7fdbe133cb5f0 (patch)
treeb08ea004216abd50570f79e4003ee8061ce51118 /drivers/ide/cris/ide-cris.c
parentide: move CONFIG_IDE_ETRAX to drivers/ide/Kconfig (diff)
downloadlinux-dev-e816056210941e9886e447e331b7fdbe133cb5f0.tar.xz
linux-dev-e816056210941e9886e447e331b7fdbe133cb5f0.zip
ide-cris: don't override ide_register_hw() result
* Don't override ide_register_hw() result and check if there is a hwif available to use. * MAX_HWIFS is user configurable nowadays so replace it by hard-coded value. * Remove the comment about ide_hwifs[]. Acked-by: Mikael Starvik <starvik@axis.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/ide/cris/ide-cris.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 7f5bc2ee6c7e..476e0d65ed43 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -773,15 +773,16 @@ init_e100_ide (void)
/* the IDE control register is at ATA address 6, with CS1 active instead of CS0 */
ide_offsets[IDE_CONTROL_OFFSET] = cris_ide_reg_addr(6, 1, 0);
- /* first fill in some stuff in the ide_hwifs fields */
+ for (h = 0; h < 4; h++) {
+ ide_hwif_t *hwif = NULL;
- for(h = 0; h < MAX_HWIFS; h++) {
- ide_hwif_t *hwif = &ide_hwifs[h];
ide_setup_ports(&hw, cris_ide_base_address(h),
ide_offsets,
0, 0, cris_ide_ack_intr,
ide_default_irq(0));
ide_register_hw(&hw, NULL, 1, &hwif);
+ if (hwif == NULL)
+ continue;
hwif->mmio = 1;
hwif->chipset = ide_etrax100;
hwif->set_pio_mode = &cris_set_pio_mode;