[ide] remove pci_disable_device() calls from setup-pci.c and sgiioc4.c

On Mon, 03 Jan 2005 21:44:33 +0000, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
> Different PCI functions are but nothing requires that the PCI function
> that is the IDE controller is only the IDE controller. In some cases
> other logic lives in the "spare" BAR register areas of the device.
>
> One example where the weird design makes it obvious is the CS5520. Here
> the 5520 bridge has the IDE in one BAR and all sorts of other logic
> (including the xBUS virtual ISA environment) in the same PCI function.
> On that chip a pci_disable_device on the IDE pci_dev turns off mundane
> things like the timer chips keyboard and mouse 8).
>
> Other vendors do equally evil things and providing the chip reports IDE
> class and has the IDE BARs set up nobody else is any the wiser and
> presumably gate count goes down.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 87475e1f
......@@ -701,17 +701,11 @@ pci_init_sgiioc4(struct pci_dev *dev, ide_pci_device_t * d)
"firmware is obsolete - please upgrade to revision"
"46 or higher\n", d->name, dev->slot_name);
ret = -EAGAIN;
goto err_disable;
goto out;
}
ret = sgiioc4_ide_setup_pci_device(dev, d);
if (ret < 0)
goto err_disable;
out:
return ret;
err_disable:
pci_disable_device(dev);
goto out;
}
static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
......
......@@ -311,13 +311,11 @@ static int ide_pci_enable(struct pci_dev *dev, ide_pci_device_t *d)
ret = pci_set_dma_mask(dev, DMA_32BIT_MASK);
if (ret < 0) {
printk(KERN_ERR "%s: can't set dma mask\n", d->name);
pci_disable_device(dev);
goto out;
}
/* FIXME: Temporary - until we put in the hotplug interface logic
Check that the bits we want are not in use by someone else.
As someone else uses it, we do not (yuck) disable the device */
Check that the bits we want are not in use by someone else. */
ret = pci_request_region(dev, 4, "ide_tmp");
if (ret < 0)
goto out;
......@@ -542,12 +540,12 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in
ret = pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
if (ret < 0) {
printk(KERN_ERR "%s: error accessing PCI regs\n", d->name);
goto err_disable;
goto out;
}
if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */
ret = ide_pci_configure(dev, d);
if (ret < 0)
goto err_disable;
goto out;
*config = 1;
printk(KERN_INFO "%s: device enabled (Linux)\n", d->name);
}
......@@ -558,17 +556,6 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in
printk(KERN_INFO "%s: chipset revision %d\n", d->name, class_rev);
out:
return ret;
err_disable:
pci_disable_device(dev);
goto out;
}
static void ide_release_pci_controller(struct pci_dev *dev, ide_pci_device_t *d,
int noisy)
{
/* Balance ide_pci_enable() */
pci_disable_device(dev);
}
/**
......@@ -701,7 +688,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
*/
ret = d->init_chipset ? d->init_chipset(dev, d->name) : 0;
if (ret < 0)
goto err_release_pci_controller;
goto out;
pciirq = ret;
} else if (tried_config) {
if (noisy)
......@@ -716,7 +703,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
if (d->init_chipset) {
ret = d->init_chipset(dev, d->name);
if (ret < 0)
goto err_release_pci_controller;
goto out;
}
if (noisy)
#ifdef __sparc__
......@@ -734,10 +721,6 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
ide_pci_setup_ports(dev, d, pciirq, index);
out:
return ret;
err_release_pci_controller:
ide_release_pci_controller(dev, d, noisy);
goto out;
}
int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment