From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g1t0029.austin.hp.com ([15.216.28.36]:9531 "EHLO g1t0029.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752184AbYBSElK (ORCPT ); Mon, 18 Feb 2008 23:41:10 -0500 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 Subject: [patch 3/4] xtensa: make pcibios_enable_device() use pcibios_enable_resources() Content-Disposition: inline; filename=xtensa-pcibios_enable_resources Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-pci@atrey.karlin.mff.cuni.cz, linux-arch@vger.kernel.org Cc: Russell King , linux-arm-kernel@lists.arm.linux.org.uk, Kyle McMartin , Matthew Wilcox , Grant Grundler , linux-parisc@vger.kernel.org, Paul Mackerras , Benjamin Herrenschmidt , linuxppc-dev@ozlabs.org, Chris Zankel 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 --