From owner-linux-pci@atrey.karlin.mff.cuni.cz Thu Nov 23 00:31:56 2006 Message-Id: <20061122230234.582071674@sodium.jf.intel.com> Date: Wed, 22 Nov 2006 12:40:32 -0800 From: Inaky Perez-Gonzalez To: gregkh@suse.de, linux-pci@atrey.karlin.mff.cuni.cz Cc: "Grant Grundler" , "Matthew Wilcox" Subject: PCI: pci_{enable,disable}_device() nestable ports Content-Disposition: inline; filename=pci-enable-disable-nestable-ports.patch From: Inaky Perez-Gonzalez Change drivers/message/i20 pci driver to simply do a nestable enable()/disable() instead of checking for it. Signed-off-by: Inaky Perez-Gonzalez Signed-off-by: Greg Kroah-Hartman --- drivers/message/i2o/pci.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) --- gregkh-2.6.orig/drivers/message/i2o/pci.c +++ gregkh-2.6/drivers/message/i2o/pci.c @@ -320,7 +320,6 @@ static int __devinit i2o_pci_probe(struc struct i2o_controller *c; int rc; struct pci_dev *i960 = NULL; - int enabled = pdev->is_enabled; printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n"); @@ -330,12 +329,11 @@ static int __devinit i2o_pci_probe(struc return -ENODEV; } - if (!enabled) - if ((rc = pci_enable_device(pdev))) { - printk(KERN_WARNING "i2o: couldn't enable device %s\n", - pci_name(pdev)); - return rc; - } + if ((rc = pci_enable_device(pdev))) { + printk(KERN_WARNING "i2o: couldn't enable device %s\n", + pci_name(pdev)); + return rc; + } if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "i2o: no suitable DMA found for %s\n", @@ -442,8 +440,7 @@ static int __devinit i2o_pci_probe(struc i2o_iop_free(c); disable: - if (!enabled) - pci_disable_device(pdev); + pci_disable_device(pdev); return rc; }