]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide.c
Merge branch 'core/locking' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6] / drivers / ide / ide.c
index b31359c9fa58b7803193b3e0dcc25e014f372d11..300431d080a97310ca829beff00f8b7dd49bb3aa 100644 (file)
@@ -352,15 +352,15 @@ void ide_unregister(ide_hwif_t *hwif)
        blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS);
        kfree(hwif->sg_table);
        unregister_blkdev(hwif->major, hwif->name);
-       spin_lock_irq(&ide_lock);
 
        if (hwif->dma_base)
                ide_release_dma_engine(hwif);
 
+       spin_lock_irq(&ide_lock);
        /* restore hwif data to pristine status */
        ide_init_port_data(hwif, hwif->index);
-
        spin_unlock_irq(&ide_lock);
+
        mutex_unlock(&ide_cfg_mtx);
 }