Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6:
pci: hotplug: pciehp: fix error code path in hpc_power_off_slot
PCI: Add DECLARE_PCI_DEVICE_TABLE macro
PCI: fix up error messages for pci_bus registering
PCI: fix section mismatch warning in pci_scan_child_bus
PCI: consolidate duplicated MSI enable functions
PCI: use dev_printk in quirk messages

+40 -50
+4 -2
Documentation/pci.txt
··· 123 123 124 124 125 125 The ID table is an array of struct pci_device_id entries ending with an 126 - all-zero entry. Each entry consists of: 126 + all-zero entry; use of the macro DECLARE_PCI_DEVICE_TABLE is the preferred 127 + method of declaring the table. Each entry consists of: 127 128 128 129 vendor,device Vendor and device ID to match (or PCI_ANY_ID) 129 130 ··· 192 191 193 192 o Do not mark the struct pci_driver. 194 193 195 - o The ID table array should be marked __devinitdata. 194 + o The ID table array should be marked __devinitconst; this is done 195 + automatically if the table is declared with DECLARE_PCI_DEVICE_TABLE(). 196 196 197 197 o The probe() and remove() functions should be marked __devinit 198 198 and __devexit respectively. All initialization functions
+6 -4
drivers/pci/bus.c
··· 145 145 child_bus = dev->subordinate; 146 146 child_bus->dev.parent = child_bus->bridge; 147 147 retval = device_register(&child_bus->dev); 148 - if (!retval) 148 + if (retval) 149 + dev_err(&dev->dev, "Error registering pci_bus," 150 + " continuing...\n"); 151 + else 149 152 retval = device_create_file(&child_bus->dev, 150 153 &dev_attr_cpuaffinity); 151 154 if (retval) 152 - dev_err(&dev->dev, "Error registering pci_bus" 153 - " device bridge symlink," 154 - " continuing...\n"); 155 + dev_err(&dev->dev, "Error creating cpuaffinity" 156 + " file, continuing...\n"); 155 157 } 156 158 } 157 159 }
+1 -1
drivers/pci/hotplug-pci.c
··· 4 4 #include "pci.h" 5 5 6 6 7 - unsigned int pci_do_scan_bus(struct pci_bus *bus) 7 + unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus) 8 8 { 9 9 unsigned int max; 10 10
+1 -1
drivers/pci/hotplug/acpiphp_glue.c
··· 1085 1085 * This function should be called per *physical slot*, 1086 1086 * not per each slot object in ACPI namespace. 1087 1087 */ 1088 - static int enable_device(struct acpiphp_slot *slot) 1088 + static int __ref enable_device(struct acpiphp_slot *slot) 1089 1089 { 1090 1090 struct pci_dev *dev; 1091 1091 struct pci_bus *bus = slot->bridge->pci_bus;
+1 -1
drivers/pci/hotplug/cpci_hotplug_pci.c
··· 250 250 * Device configuration functions 251 251 */ 252 252 253 - int cpci_configure_slot(struct slot* slot) 253 + int __ref cpci_configure_slot(struct slot *slot) 254 254 { 255 255 struct pci_bus *parent; 256 256 int fn;
+3 -2
drivers/pci/hotplug/pciehp_hpc.c
··· 711 711 retval = pcie_write_cmd(slot, slot_cmd, cmd_mask); 712 712 if (retval) { 713 713 err("%s: Write command failed!\n", __FUNCTION__); 714 - return -1; 714 + retval = -1; 715 + goto out; 715 716 } 716 717 dbg("%s: SLOTCTRL %x write cmd %x\n", 717 718 __FUNCTION__, ctrl->cap_base + SLOTCTRL, slot_cmd); ··· 723 722 * removed from the slot/adapter. 724 723 */ 725 724 msleep(1000); 726 - 725 + out: 727 726 if (changed) 728 727 pcie_unmask_bad_dllp(ctrl); 729 728
+1 -1
drivers/pci/hotplug/pciehp_pci.c
··· 167 167 } 168 168 } 169 169 170 - static int pciehp_add_bridge(struct pci_dev *dev) 170 + static int __ref pciehp_add_bridge(struct pci_dev *dev) 171 171 { 172 172 struct pci_bus *parent = dev->bus; 173 173 int pass, busnr, start = parent->secondary;
+1 -1
drivers/pci/hotplug/shpchp_pci.c
··· 96 96 } 97 97 } 98 98 99 - int shpchp_configure_device(struct slot *p_slot) 99 + int __ref shpchp_configure_device(struct slot *p_slot) 100 100 { 101 101 struct pci_dev *dev; 102 102 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
+4 -4
drivers/pci/probe.c
··· 286 286 } 287 287 } 288 288 289 - void pci_read_bridge_bases(struct pci_bus *child) 289 + void __devinit pci_read_bridge_bases(struct pci_bus *child) 290 290 { 291 291 struct pci_dev *dev = child->self; 292 292 u8 io_base_lo, io_limit_lo; ··· 472 472 * them, we proceed to assigning numbers to the remaining buses in 473 473 * order to avoid overlaps between old and new bus numbers. 474 474 */ 475 - int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass) 475 + int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) 476 476 { 477 477 struct pci_bus *child; 478 478 int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS); ··· 1008 1008 return nr; 1009 1009 } 1010 1010 1011 - unsigned int pci_scan_child_bus(struct pci_bus *bus) 1011 + unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus) 1012 1012 { 1013 1013 unsigned int devfn, pass, max = bus->secondary; 1014 1014 struct pci_dev *dev; ··· 1116 1116 return NULL; 1117 1117 } 1118 1118 1119 - struct pci_bus *pci_scan_bus_parented(struct device *parent, 1119 + struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, 1120 1120 int bus, struct pci_ops *ops, void *sysdata) 1121 1121 { 1122 1122 struct pci_bus *b;
+8 -33
drivers/pci/quirks.c
··· 1652 1652 pci_write_config_byte(dev, 0x75, 0x1); 1653 1653 pci_write_config_byte(dev, 0x77, 0x0); 1654 1654 1655 - printk(KERN_INFO 1656 - "PCI: VIA CX700 PCI parking/caching fixup on %s\n", 1657 - pci_name(dev)); 1655 + dev_info(&dev->dev, 1656 + "Disabling VIA CX700 PCI parking/caching\n"); 1658 1657 } 1659 1658 } 1660 1659 } ··· 1725 1726 quirk_msi_ht_cap); 1726 1727 1727 1728 1728 - /* 1729 - * Force enable MSI mapping capability on HT bridges 1730 - */ 1731 - static void __devinit quirk_msi_ht_cap_enable(struct pci_dev *dev) 1732 - { 1733 - int pos, ttl = 48; 1734 - 1735 - pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); 1736 - while (pos && ttl--) { 1737 - u8 flags; 1738 - 1739 - if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) { 1740 - printk(KERN_INFO "PCI: Enabling HT MSI Mapping on %s\n", 1741 - pci_name(dev)); 1742 - 1743 - pci_write_config_byte(dev, pos + HT_MSI_FLAGS, 1744 - flags | HT_MSI_FLAGS_ENABLE); 1745 - } 1746 - pos = pci_find_next_ht_capability(dev, pos, 1747 - HT_CAPTYPE_MSI_MAPPING); 1748 - } 1749 - } 1750 - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 1751 - PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, 1752 - quirk_msi_ht_cap_enable); 1753 - 1754 1729 /* The nVidia CK804 chipset may have 2 HT MSI mappings. 1755 1730 * MSI are supported if the MSI capability set in any of these mappings. 1756 1731 */ ··· 1751 1778 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, 1752 1779 quirk_nvidia_ck804_msi_ht_cap); 1753 1780 1754 - /* 1755 - * Force enable MSI mapping capability on HT bridges */ 1756 - static inline void ht_enable_msi_mapping(struct pci_dev *dev) 1781 + /* Force enable MSI mapping capability on HT bridges */ 1782 + static void __devinit ht_enable_msi_mapping(struct pci_dev *dev) 1757 1783 { 1758 1784 int pos, ttl = 48; 1759 1785 ··· 1771 1799 HT_CAPTYPE_MSI_MAPPING); 1772 1800 } 1773 1801 } 1802 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 1803 + PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, 1804 + ht_enable_msi_mapping); 1774 1805 1775 1806 static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) 1776 1807 { ··· 1805 1830 1806 1831 if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, 1807 1832 &flags) == 0) { 1808 - dev_info(&dev->dev, "Quirk disabling HT MSI mapping"); 1833 + dev_info(&dev->dev, "Disabling HT MSI mapping"); 1809 1834 pci_write_config_byte(dev, pos + HT_MSI_FLAGS, 1810 1835 flags & ~HT_MSI_FLAGS_ENABLE); 1811 1836 }
+10
include/linux/pci.h
··· 389 389 #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver) 390 390 391 391 /** 392 + * DECLARE_PCI_DEVICE_TABLE - macro used to describe a pci device table 393 + * @_table: device table name 394 + * 395 + * This macro is used to create a struct pci_device_id array (a device table) 396 + * in a generic manner. 397 + */ 398 + #define DECLARE_PCI_DEVICE_TABLE(_table) \ 399 + const struct pci_device_id _table[] __devinitconst 400 + 401 + /** 392 402 * PCI_DEVICE - macro used to describe a specific pci device 393 403 * @vend: the 16 bit PCI Vendor ID 394 404 * @dev: the 16 bit PCI Device ID