[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-24
Subject:    ia64: Sync with pcibios_enable_device interface change
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2002-09-27 23:37:53
[Download RAW message or body]

ChangeSet 1.676.7.22, 2002/09/27 17:37:53-06:00, bjorn_helgaas@hp.com

	ia64: Sync with pcibios_enable_device interface change


# This patch includes the following deltas:
#	           ChangeSet	1.676.7.21 -> 1.676.7.22
#	arch/ia64/kernel/pci.c	1.7     -> 1.8    
#

 pci.c |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)


diff -Nru a/arch/ia64/kernel/pci.c b/arch/ia64/kernel/pci.c
--- a/arch/ia64/kernel/pci.c	Wed Dec 18 11:32:47 2002
+++ b/arch/ia64/kernel/pci.c	Wed Dec 18 11:32:47 2002
@@ -339,8 +339,8 @@
 	ranges->mem_end -= bus->resource[1]->start;
 }
 
-int
-pcibios_enable_device (struct pci_dev *dev)
+static inline int
+pcibios_enable_resources (struct pci_dev *dev, int mask)
 {
 	u16 cmd, old_cmd;
 	int idx;
@@ -349,11 +349,13 @@
 	if (!dev)
 		return -EINVAL;
 
- 	platform_pci_enable_device(dev);
-
 	pci_read_config_word(dev, PCI_COMMAND, &cmd);
 	old_cmd = cmd;
 	for (idx=0; idx<6; idx++) {
+		/* Only set up the desired resources.  */
+		if (!(mask & (1 << idx)))
+			continue;
+
 		r = &dev->resource[idx];
 		if (!r->start && r->end) {
 			printk(KERN_ERR
@@ -372,6 +374,19 @@
 		printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd);
 		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
+	return 0;
+}
+
+int
+pcibios_enable_device (struct pci_dev *dev, int mask)
+{
+	int ret;
+
+	ret = pcibios_enable_resources(dev, mask);
+	if (ret < 0)
+		return ret;
+
+ 	platform_pci_enable_device(dev);
 
 	printk(KERN_INFO "PCI: Found IRQ %d for device %s\n", dev->irq, dev->slot_name);
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic