Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 387750c3 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent bf64b7a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static void __devexit rapide_remove(struct expansion_card *ec)

	ecard_set_drvdata(ec, NULL);

	ide_unregister(hwif->index);
	ide_unregister(hwif);

	ecard_release_resources(ec);
}
+1 −4
Original line number Diff line number Diff line
@@ -82,10 +82,7 @@ static void idepnp_remove(struct pnp_dev *dev)
{
	ide_hwif_t *hwif = pnp_get_drvdata(dev);

	if (hwif)
		ide_unregister(hwif->index);
	else
		printk(KERN_ERR "idepnp: Unable to remove device, please report.\n");
	ide_unregister(hwif);

	release_region(pnp_port_start(dev, 1), 1);
	release_region(pnp_port_start(dev, 0), 8);
+4 −7
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_devices);

/**
 *	ide_unregister		-	free an IDE interface
 *	@index: index of interface (will change soon to a pointer)
 *	@hwif: IDE interface
 *
 *	Perform the final unregister of an IDE interface. At the moment
 *	we don't refcount interfaces so this will also get split up.
@@ -307,19 +307,16 @@ EXPORT_SYMBOL_GPL(ide_port_unregister_devices);
 *	This is raving bonkers.
 */

void ide_unregister(unsigned int index)
void ide_unregister(ide_hwif_t *hwif)
{
	ide_hwif_t *hwif, *g;
	ide_hwif_t *g;
	ide_hwgroup_t *hwgroup;
	int irq_count = 0;

	BUG_ON(index >= MAX_HWIFS);

	BUG_ON(in_interrupt());
	BUG_ON(irqs_disabled());
	mutex_lock(&ide_cfg_mtx);
	spin_lock_irq(&ide_lock);
	hwif = &ide_hwifs[index];
	if (!hwif->present)
		goto abort;
	__ide_port_unregister_devices(hwif);
@@ -360,7 +357,7 @@ void ide_unregister(unsigned int index)
		ide_release_dma_engine(hwif);

	/* restore hwif data to pristine status */
	ide_init_port_data(hwif, index);
	ide_init_port_data(hwif, hwif->index);

abort:
	spin_unlock_irq(&ide_lock);
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ void ide_release(struct pcmcia_device *link)
    if (info->ndev) {
	/* FIXME: if this fails we need to queue the cleanup somehow
	   -- need to investigate the required PCMCIA magic */
	ide_unregister(hwif->index);
	ide_unregister(hwif);
    }
    info->ndev = 0;

+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ static int __devexit plat_ide_remove(struct platform_device *pdev)
{
	ide_hwif_t *hwif = pdev->dev.driver_data;

	ide_unregister(hwif->index);
	ide_unregister(hwif);

	return 0;
}
Loading