diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 53c6a038e179..7bcc4c452255 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_devices); | |||
287 | 287 | ||
288 | /** | 288 | /** |
289 | * ide_unregister - free an IDE interface | 289 | * ide_unregister - free an IDE interface |
290 | * @index: index of interface (will change soon to a pointer) | 290 | * @hwif: IDE interface |
291 | * | 291 | * |
292 | * Perform the final unregister of an IDE interface. At the moment | 292 | * Perform the final unregister of an IDE interface. At the moment |
293 | * we don't refcount interfaces so this will also get split up. | 293 | * we don't refcount interfaces so this will also get split up. |
@@ -307,19 +307,16 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_devices); | |||
307 | * This is raving bonkers. | 307 | * This is raving bonkers. |
308 | */ | 308 | */ |
309 | 309 | ||
310 | void ide_unregister(unsigned int index) | 310 | void ide_unregister(ide_hwif_t *hwif) |
311 | { | 311 | { |
312 | ide_hwif_t *hwif, *g; | 312 | ide_hwif_t *g; |
313 | ide_hwgroup_t *hwgroup; | 313 | ide_hwgroup_t *hwgroup; |
314 | int irq_count = 0; | 314 | int irq_count = 0; |
315 | 315 | ||
316 | BUG_ON(index >= MAX_HWIFS); | ||
317 | |||
318 | BUG_ON(in_interrupt()); | 316 | BUG_ON(in_interrupt()); |
319 | BUG_ON(irqs_disabled()); | 317 | BUG_ON(irqs_disabled()); |
320 | mutex_lock(&ide_cfg_mtx); | 318 | mutex_lock(&ide_cfg_mtx); |
321 | spin_lock_irq(&ide_lock); | 319 | spin_lock_irq(&ide_lock); |
322 | hwif = &ide_hwifs[index]; | ||
323 | if (!hwif->present) | 320 | if (!hwif->present) |
324 | goto abort; | 321 | goto abort; |
325 | __ide_port_unregister_devices(hwif); | 322 | __ide_port_unregister_devices(hwif); |
@@ -360,7 +357,7 @@ void ide_unregister(unsigned int index) | |||
360 | ide_release_dma_engine(hwif); | 357 | ide_release_dma_engine(hwif); |
361 | 358 | ||
362 | /* restore hwif data to pristine status */ | 359 | /* restore hwif data to pristine status */ |
363 | ide_init_port_data(hwif, index); | 360 | ide_init_port_data(hwif, hwif->index); |
364 | 361 | ||
365 | abort: | 362 | abort: |
366 | spin_unlock_irq(&ide_lock); | 363 | spin_unlock_irq(&ide_lock); |