[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) ...@@ -701,17 +701,11 @@ pci_init_sgiioc4(struct pci_dev *dev, ide_pci_device_t * d)
"firmware is obsolete - please upgrade to revision" "firmware is obsolete - please upgrade to revision"
"46 or higher\n", d->name, dev->slot_name); "46 or higher\n", d->name, dev->slot_name);
ret = -EAGAIN; ret = -EAGAIN;
goto err_disable; goto out;
} }
ret = sgiioc4_ide_setup_pci_device(dev, d); ret = sgiioc4_ide_setup_pci_device(dev, d);
if (ret < 0)
goto err_disable;
out: out:
return ret; return ret;
err_disable:
pci_disable_device(dev);
goto out;
} }
static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = { 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) ...@@ -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); ret = pci_set_dma_mask(dev, DMA_32BIT_MASK);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: can't set dma mask\n", d->name); printk(KERN_ERR "%s: can't set dma mask\n", d->name);
pci_disable_device(dev);
goto out; goto out;
} }
/* FIXME: Temporary - until we put in the hotplug interface logic /* FIXME: Temporary - until we put in the hotplug interface logic
Check that the bits we want are not in use by someone else. 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 */
ret = pci_request_region(dev, 4, "ide_tmp"); ret = pci_request_region(dev, 4, "ide_tmp");
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -542,12 +540,12 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in ...@@ -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); ret = pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: error accessing PCI regs\n", d->name); printk(KERN_ERR "%s: error accessing PCI regs\n", d->name);
goto err_disable; goto out;
} }
if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */ if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */
ret = ide_pci_configure(dev, d); ret = ide_pci_configure(dev, d);
if (ret < 0) if (ret < 0)
goto err_disable; goto out;
*config = 1; *config = 1;
printk(KERN_INFO "%s: device enabled (Linux)\n", d->name); 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 ...@@ -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); printk(KERN_INFO "%s: chipset revision %d\n", d->name, class_rev);
out: out:
return ret; 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, ...@@ -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; ret = d->init_chipset ? d->init_chipset(dev, d->name) : 0;
if (ret < 0) if (ret < 0)
goto err_release_pci_controller; goto out;
pciirq = ret; pciirq = ret;
} else if (tried_config) { } else if (tried_config) {
if (noisy) if (noisy)
...@@ -716,7 +703,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d, ...@@ -716,7 +703,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d,
if (d->init_chipset) { if (d->init_chipset) {
ret = d->init_chipset(dev, d->name); ret = d->init_chipset(dev, d->name);
if (ret < 0) if (ret < 0)
goto err_release_pci_controller; goto out;
} }
if (noisy) if (noisy)
#ifdef __sparc__ #ifdef __sparc__
...@@ -734,10 +721,6 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d, ...@@ -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); ide_pci_setup_ports(dev, d, pciirq, index);
out: out:
return ret; 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) 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