diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:36 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:36 -0500 |
commit | cae5c82022cd710ff1eedd39ca8c56b081177b18 (patch) | |
tree | b3a9b20da3c022fe369d890627c33c82e060b345 /drivers/ide/ide-probe.c | |
parent | 96e5ad309c423bc0793e746337d5632ee5a49769 (diff) |
ide: prepare init_irq() for using ide_remove_port_from_hwgroup()
* BUG_ON() early if 'hwif->next == hwif' and there is a 'match' hwgroup.
* Remove printk() for impossible condition and add a BUG_ON(hwgroup->drive)
to match code in ide_unregister().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 84810aa57a67..88c77d63c01f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -996,6 +996,7 @@ static int init_irq (ide_hwif_t *hwif) | |||
996 | spin_lock_irq(&ide_lock); | 996 | spin_lock_irq(&ide_lock); |
997 | hwif->next = hwgroup->hwif->next; | 997 | hwif->next = hwgroup->hwif->next; |
998 | hwgroup->hwif->next = hwif; | 998 | hwgroup->hwif->next = hwif; |
999 | BUG_ON(hwif->next == hwif); | ||
999 | spin_unlock_irq(&ide_lock); | 1000 | spin_unlock_irq(&ide_lock); |
1000 | } else { | 1001 | } else { |
1001 | hwgroup = kmalloc_node(sizeof(*hwgroup), GFP_KERNEL|__GFP_ZERO, | 1002 | hwgroup = kmalloc_node(sizeof(*hwgroup), GFP_KERNEL|__GFP_ZERO, |
@@ -1075,7 +1076,6 @@ static int init_irq (ide_hwif_t *hwif) | |||
1075 | out_unlink: | 1076 | out_unlink: |
1076 | spin_lock_irq(&ide_lock); | 1077 | spin_lock_irq(&ide_lock); |
1077 | if (hwif->next == hwif) { | 1078 | if (hwif->next == hwif) { |
1078 | BUG_ON(match); | ||
1079 | BUG_ON(hwgroup->hwif != hwif); | 1079 | BUG_ON(hwgroup->hwif != hwif); |
1080 | kfree(hwgroup); | 1080 | kfree(hwgroup); |
1081 | } else { | 1081 | } else { |
@@ -1085,8 +1085,7 @@ out_unlink: | |||
1085 | g = g->next; | 1085 | g = g->next; |
1086 | g->next = hwif->next; | 1086 | g->next = hwif->next; |
1087 | if (hwgroup->hwif == hwif) { | 1087 | if (hwgroup->hwif == hwif) { |
1088 | /* Impossible. */ | 1088 | BUG_ON(hwgroup->drive); |
1089 | printk(KERN_ERR "Duh. Uninitialized hwif listed as active hwif.\n"); | ||
1090 | hwgroup->hwif = g; | 1089 | hwgroup->hwif = g; |
1091 | } | 1090 | } |
1092 | BUG_ON(hwgroup->hwif == hwif); | 1091 | BUG_ON(hwgroup->hwif == hwif); |