summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-05 20:30:51 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-05 20:30:51 +0200
commitbd8a59e29726b2a5ff7baefe995febdc63044a61 (patch)
treeb539d13ba01929dd5c0500acce6e3a4d6b40469c /drivers
parent7cd95f56cb61f5348d062527c9d3653196f6e629 (diff)
downloadlinux-bd8a59e29726b2a5ff7baefe995febdc63044a61.tar.gz
linux-bd8a59e29726b2a5ff7baefe995febdc63044a61.tar.bz2
linux-bd8a59e29726b2a5ff7baefe995febdc63044a61.zip
ide: ide_unregister() warm-plug bugfix
Fix ide_unregister() to work for ports with no devices attached to them. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 246077792e21..b31359c9fa58 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -315,13 +315,14 @@ void ide_unregister(ide_hwif_t *hwif)
BUG_ON(in_interrupt());
BUG_ON(irqs_disabled());
+
mutex_lock(&ide_cfg_mtx);
- spin_lock_irq(&ide_lock);
- if (!hwif->present)
- goto abort;
- __ide_port_unregister_devices(hwif);
- hwif->present = 0;
+ spin_lock_irq(&ide_lock);
+ if (hwif->present) {
+ __ide_port_unregister_devices(hwif);
+ hwif->present = 0;
+ }
spin_unlock_irq(&ide_lock);
ide_proc_unregister_port(hwif);
@@ -359,7 +360,6 @@ void ide_unregister(ide_hwif_t *hwif)
/* restore hwif data to pristine status */
ide_init_port_data(hwif, hwif->index);
-abort:
spin_unlock_irq(&ide_lock);
mutex_unlock(&ide_cfg_mtx);
}