aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:31 -0400
commit387750c3bf49c22f6189436032145e2131985076 (patch)
tree823d10a2e5008048990d66643819a36d5fc70b3f /drivers/ide/ide.c
parentbf64b7a9ddc604883a1f41535d3d7a62bca9ee81 (diff)
ide: make ide_unregister() take 'ide_hwif_t *' as an argument (take 2)
* Make ide_unregister() take 'ide_hwif_t *hwif' instead of 'unsigned int index' (hwif->index) as an argument and update all users accordingly. While at it: * Remove unnecessary checks for hwif != NULL from ide-pnp.c::idepnp_remove() and delkin_cb.c::delkin_cb_remove(). * Remove needless hwif->chipset assignment from scc_pata.c::scc_remove(). v2: * Fixup ide_unregister() documentation. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c11
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
310void ide_unregister(unsigned int index) 310void 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
365abort: 362abort:
366 spin_unlock_irq(&ide_lock); 363 spin_unlock_irq(&ide_lock);