/* Set up the PCI and controller side of the IDE interface. This brings up the PCI side of the device, checks that the device is enabled and enables it if need be  */
static int ide_setup_pci_controller(struct pci_dev *dev, const struct ide_port_info *d, int noisy)
/* Set up the PCI and controller side of the IDE interface. This brings up the PCI side of the device, checks that the device is enabled and enables it if need be  */
static int ide_setup_pci_controller(struct pci_dev *dev, const struct ide_port_info *d, int noisy)
{
	int ret;
	u16 pcicmd;
	if (noisy)
		ide_setup_pci_noise(dev, d);
	ret = ide_pci_enable(dev, d);
	if (ret < 0)
		goto out;
	ret = pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
	if (ret < 0) {
		printk(KERN_ERR "%s %s: error accessing PCI regs\n",
			d->name, pci_name(dev));
		goto out;
	}
	if (!(pcicmd & PCI_COMMAND_IO)) {
		ret = ide_pci_configure(dev, d);
		if (ret < 0)
			goto out;
		printk(KERN_INFO "%s %s: device enabled (Linux)\n",
			d->name, pci_name(dev));
	}
out:
	return ret;
}