From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g1t0029.austin.hp.com (g1t0029.austin.hp.com [15.216.28.36]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bastion.smtp.hp.com", Issuer "RSA Data Security, Inc." (verified OK)) by ozlabs.org (Postfix) with ESMTP id C465ADDE34 for ; Tue, 19 Feb 2008 15:57:19 +1100 (EST) Message-Id: <20080219044307.679302332@ldl.fc.hp.com> References: <20080219043952.845136014@ldl.fc.hp.com> Date: Mon, 18 Feb 2008 21:39:55 -0700 From: Bjorn Helgaas To: linux-pci@atrey.karlin.mff.cuni.cz To: linux-arch@vger.kernel.org Subject: [patch 3/4] xtensa: make pcibios_enable_device() use pcibios_enable_resources() Cc: Chris Zankel , Grant Grundler , linux-parisc@vger.kernel.org, Matthew Wilcox , Kyle McMartin , linuxppc-dev@ozlabs.org, Paul Mackerras , linux-arm-kernel@lists.arm.linux.org.uk, Russell King List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , pcibios_enable_device() has an almost verbatim copy of pcibios_enable_resources(), (the only difference is that pcibios_enable_resources() turns on PCI_COMMAND_MEMORY if there's a ROM resource). The duplication might be intentional, but I don't see any callers of pcibios_enable_resources() on xtensa, so I think it's more likely a historical accident copied from ppc. This patch removes the duplication, making pcibios_enable_device() simply call pcibios_enable_resources() as x86 does. Signed-off-by: Bjorn Helgaas Index: work6/arch/xtensa/kernel/pci.c =================================================================== --- work6.orig/arch/xtensa/kernel/pci.c 2008-02-18 10:43:50.000000000 -0700 +++ work6/arch/xtensa/kernel/pci.c 2008-02-18 11:32:12.000000000 -0700 @@ -238,31 +238,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) { - u16 cmd, old_cmd; - int idx; - struct resource *r; - - pci_read_config_word(dev, PCI_COMMAND, &cmd); - old_cmd = cmd; - for (idx=0; idx<6; idx++) { - r = &dev->resource[idx]; - if (!r->start && r->end) { - printk(KERN_ERR "PCI: Device %s not available because " - "of resource collisions\n", pci_name(dev)); - return -EINVAL; - } - if (r->flags & IORESOURCE_IO) - cmd |= PCI_COMMAND_IO; - if (r->flags & IORESOURCE_MEM) - cmd |= PCI_COMMAND_MEMORY; - } - if (cmd != old_cmd) { - printk("PCI: Enabling device %s (%04x -> %04x)\n", - pci_name(dev), old_cmd, cmd); - pci_write_config_word(dev, PCI_COMMAND, cmd); - } - - return 0; + return pcibios_enable_resources(dev, mask); } #ifdef CONFIG_PROC_FS --