aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
315 315
316 BUG_ON(in_interrupt()); 316 BUG_ON(in_interrupt());
317 BUG_ON(irqs_disabled()); 317 BUG_ON(irqs_disabled());
318
318 mutex_lock(&ide_cfg_mtx); 319 mutex_lock(&ide_cfg_mtx);
319 spin_lock_irq(&ide_lock);
320 if (!hwif->present)
321 goto abort;
322 __ide_port_unregister_devices(hwif);
323 hwif->present = 0;
324 320
321 spin_lock_irq(&ide_lock);
322 if (hwif->present) {
323 __ide_port_unregister_devices(hwif);
324 hwif->present = 0;
325 }
325 spin_unlock_irq(&ide_lock); 326 spin_unlock_irq(&ide_lock);
326 327
327 ide_proc_unregister_port(hwif); 328 ide_proc_unregister_port(hwif);
@@ -359,7 +360,6 @@ void ide_unregister(ide_hwif_t *hwif)
359 /* restore hwif data to pristine status */ 360 /* restore hwif data to pristine status */
360 ide_init_port_data(hwif, hwif->index); 361 ide_init_port_data(hwif, hwif->index);
361 362
362abort:
363 spin_unlock_irq(&ide_lock); 363 spin_unlock_irq(&ide_lock);
364 mutex_unlock(&ide_cfg_mtx); 364 mutex_unlock(&ide_cfg_mtx);
365} 365}