aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:30 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-12-29 14:27:30 -0500
commit44e312310889145b47311a311d3faf2488349116 (patch)
treebd4881b0bf875be77a75f57f097584610a78c1bd /drivers/ide
parent1f473e9c92ea458e60494561a2065a358b7239bb (diff)
ide: __ide_port_unregister_devices() doesn't need an ide_lock held
[ and ide_cfg_mtx mutex provides a sufficient protection for callers ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 04f8f13cb9d7..bca6877ee6a5 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -130,7 +130,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
130 } 130 }
131} 131}
132 132
133/* Called with ide_lock held. */
134static void __ide_port_unregister_devices(ide_hwif_t *hwif) 133static void __ide_port_unregister_devices(ide_hwif_t *hwif)
135{ 134{
136 int i; 135 int i;
@@ -139,10 +138,8 @@ static void __ide_port_unregister_devices(ide_hwif_t *hwif)
139 ide_drive_t *drive = &hwif->drives[i]; 138 ide_drive_t *drive = &hwif->drives[i];
140 139
141 if (drive->dev_flags & IDE_DFLAG_PRESENT) { 140 if (drive->dev_flags & IDE_DFLAG_PRESENT) {
142 spin_unlock_irq(&ide_lock);
143 device_unregister(&drive->gendev); 141 device_unregister(&drive->gendev);
144 wait_for_completion(&drive->gendev_rel_comp); 142 wait_for_completion(&drive->gendev_rel_comp);
145 spin_lock_irq(&ide_lock);
146 } 143 }
147 } 144 }
148} 145}
@@ -150,11 +147,9 @@ static void __ide_port_unregister_devices(ide_hwif_t *hwif)
150void ide_port_unregister_devices(ide_hwif_t *hwif) 147void ide_port_unregister_devices(ide_hwif_t *hwif)
151{ 148{
152 mutex_lock(&ide_cfg_mtx); 149 mutex_lock(&ide_cfg_mtx);
153 spin_lock_irq(&ide_lock);
154 __ide_port_unregister_devices(hwif); 150 __ide_port_unregister_devices(hwif);
155 hwif->present = 0; 151 hwif->present = 0;
156 ide_port_init_devices_data(hwif); 152 ide_port_init_devices_data(hwif);
157 spin_unlock_irq(&ide_lock);
158 mutex_unlock(&ide_cfg_mtx); 153 mutex_unlock(&ide_cfg_mtx);
159} 154}
160EXPORT_SYMBOL_GPL(ide_port_unregister_devices); 155EXPORT_SYMBOL_GPL(ide_port_unregister_devices);
@@ -192,12 +187,10 @@ void ide_unregister(ide_hwif_t *hwif)
192 187
193 mutex_lock(&ide_cfg_mtx); 188 mutex_lock(&ide_cfg_mtx);
194 189
195 spin_lock_irq(&ide_lock);
196 if (hwif->present) { 190 if (hwif->present) {
197 __ide_port_unregister_devices(hwif); 191 __ide_port_unregister_devices(hwif);
198 hwif->present = 0; 192 hwif->present = 0;
199 } 193 }
200 spin_unlock_irq(&ide_lock);
201 194
202 ide_proc_unregister_port(hwif); 195 ide_proc_unregister_port(hwif);
203 196