aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-07-31 20:37:25 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-31 20:37:25 -0400
commit57cad8084e0837e0f2c97da789ec9b3f36809be9 (patch)
treee9c790afb4286f78cb08d9664f58baa7e876fe55 /drivers/pci
parentcb18bd40030c879cd93fef02fd579f74dbab473d (diff)
parent49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff)
Merge branch 'merge'
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/Kconfig5
-rw-r--r--drivers/pci/msi.c4
-rw-r--r--drivers/pci/pci.c11
-rw-r--r--drivers/pci/pci.h10
-rw-r--r--drivers/pci/probe.c1
-rw-r--r--drivers/pci/quirks.c108
-rw-r--r--drivers/pci/search.c46
7 files changed, 157 insertions, 28 deletions
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 222a1cc4aa28..3fae77ffb2fa 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -6,8 +6,7 @@ menu "PCI Hotplug Support"
6 6
7config HOTPLUG_PCI 7config HOTPLUG_PCI
8 tristate "Support for PCI Hotplug (EXPERIMENTAL)" 8 tristate "Support for PCI Hotplug (EXPERIMENTAL)"
9 depends on PCI && EXPERIMENTAL 9 depends on PCI && EXPERIMENTAL && HOTPLUG
10 select HOTPLUG
11 ---help--- 10 ---help---
12 Say Y here if you have a motherboard with a PCI Hotplug controller. 11 Say Y here if you have a motherboard with a PCI Hotplug controller.
13 This allows you to add and remove PCI cards while the machine is 12 This allows you to add and remove PCI cards while the machine is
@@ -77,7 +76,7 @@ config HOTPLUG_PCI_IBM
77 76
78config HOTPLUG_PCI_ACPI 77config HOTPLUG_PCI_ACPI
79 tristate "ACPI PCI Hotplug driver" 78 tristate "ACPI PCI Hotplug driver"
80 depends on ACPI && HOTPLUG_PCI 79 depends on ACPI_DOCK && HOTPLUG_PCI
81 help 80 help
82 Say Y here if you have a system that supports PCI Hotplug using 81 Say Y here if you have a system that supports PCI Hotplug using
83 ACPI. 82 ACPI.
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 36bc7c415af7..a83c1f5735d6 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -47,13 +47,13 @@ msi_register(struct msi_ops *ops)
47 47
48static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) 48static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags)
49{ 49{
50 memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); 50 memset(p, 0, sizeof(struct msi_desc));
51} 51}
52 52
53static int msi_cache_init(void) 53static int msi_cache_init(void)
54{ 54{
55 msi_cachep = kmem_cache_create("msi_cache", 55 msi_cachep = kmem_cache_create("msi_cache",
56 NR_IRQS * sizeof(struct msi_desc), 56 sizeof(struct msi_desc),
57 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL); 57 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL);
58 if (!msi_cachep) 58 if (!msi_cachep)
59 return -ENOMEM; 59 return -ENOMEM;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index cf57d7de3765..9f79dd6d51ab 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -19,6 +19,7 @@
19#include <asm/dma.h> /* isa_dma_bridge_buggy */ 19#include <asm/dma.h> /* isa_dma_bridge_buggy */
20#include "pci.h" 20#include "pci.h"
21 21
22unsigned int pci_pm_d3_delay = 10;
22 23
23/** 24/**
24 * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children 25 * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
@@ -313,6 +314,14 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
313 } else if (dev->current_state == state) 314 } else if (dev->current_state == state)
314 return 0; /* we're already there */ 315 return 0; /* we're already there */
315 316
317 /*
318 * If the device or the parent bridge can't support PCI PM, ignore
319 * the request if we're doing anything besides putting it into D0
320 * (which would only happen on boot).
321 */
322 if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev))
323 return 0;
324
316 /* find PCI PM capability in list */ 325 /* find PCI PM capability in list */
317 pm = pci_find_capability(dev, PCI_CAP_ID_PM); 326 pm = pci_find_capability(dev, PCI_CAP_ID_PM);
318 327
@@ -363,7 +372,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
363 /* Mandatory power management transition delays */ 372 /* Mandatory power management transition delays */
364 /* see PCI PM 1.1 5.6.1 table 18 */ 373 /* see PCI PM 1.1 5.6.1 table 18 */
365 if (state == PCI_D3hot || dev->current_state == PCI_D3hot) 374 if (state == PCI_D3hot || dev->current_state == PCI_D3hot)
366 msleep(10); 375 msleep(pci_pm_d3_delay);
367 else if (state == PCI_D2 || dev->current_state == PCI_D2) 376 else if (state == PCI_D2 || dev->current_state == PCI_D2)
368 udelay(200); 377 udelay(200);
369 378
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 9cc842b666eb..08d58fc78ee1 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -47,7 +47,7 @@ extern int pci_msi_quirk;
47#else 47#else
48#define pci_msi_quirk 0 48#define pci_msi_quirk 0
49#endif 49#endif
50 50extern unsigned int pci_pm_d3_delay;
51#ifdef CONFIG_PCI_MSI 51#ifdef CONFIG_PCI_MSI
52void disable_msi_mode(struct pci_dev *dev, int pos, int type); 52void disable_msi_mode(struct pci_dev *dev, int pos, int type);
53void pci_no_msi(void); 53void pci_no_msi(void);
@@ -66,7 +66,15 @@ static inline int pci_save_msix_state(struct pci_dev *dev) { return 0; }
66static inline void pci_restore_msi_state(struct pci_dev *dev) {} 66static inline void pci_restore_msi_state(struct pci_dev *dev) {}
67static inline void pci_restore_msix_state(struct pci_dev *dev) {} 67static inline void pci_restore_msix_state(struct pci_dev *dev) {}
68#endif 68#endif
69static inline int pci_no_d1d2(struct pci_dev *dev)
70{
71 unsigned int parent_dstates = 0;
69 72
73 if (dev->bus->self)
74 parent_dstates = dev->bus->self->no_d1d2;
75 return (dev->no_d1d2 || parent_dstates);
76
77}
70extern int pcie_mch_quirk; 78extern int pcie_mch_quirk;
71extern struct device_attribute pci_dev_attrs[]; 79extern struct device_attribute pci_dev_attrs[];
72extern struct class_device_attribute class_device_attr_cpuaffinity; 80extern struct class_device_attribute class_device_attr_cpuaffinity;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f89dbc3738b7..c5a58d1c6c1c 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -815,6 +815,7 @@ pci_scan_device(struct pci_bus *bus, int devfn)
815 dev->vendor = l & 0xffff; 815 dev->vendor = l & 0xffff;
816 dev->device = (l >> 16) & 0xffff; 816 dev->device = (l >> 16) & 0xffff;
817 dev->cfg_size = pci_cfg_space_size(dev); 817 dev->cfg_size = pci_cfg_space_size(dev);
818 dev->error_state = pci_channel_io_normal;
818 819
819 /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer) 820 /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer)
820 set this higher, assuming the system even supports it. */ 821 set this higher, assuming the system even supports it. */
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index d1d7333bb71b..e3c78c39b7e4 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -400,6 +400,7 @@ static void __devinit quirk_piix4_acpi(struct pci_dev *dev)
400 piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20); 400 piix4_io_quirk(dev, "PIIX4 devres J", 0x7c, 1 << 20);
401} 401}
402DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi ); 402DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi );
403DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, quirk_piix4_acpi );
403 404
404/* 405/*
405 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at 406 * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
@@ -682,6 +683,33 @@ static void __devinit quirk_vt82c598_id(struct pci_dev *dev)
682} 683}
683DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id ); 684DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id );
684 685
686#ifdef CONFIG_ACPI_SLEEP
687
688/*
689 * Some VIA systems boot with the abnormal status flag set. This can cause
690 * the BIOS to re-POST the system on resume rather than passing control
691 * back to the OS. Clear the flag on boot
692 */
693static void __devinit quirk_via_abnormal_poweroff(struct pci_dev *dev)
694{
695 u32 reg;
696
697 acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS,
698 &reg);
699
700 if (reg & 0x800) {
701 printk("Clearing abnormal poweroff flag\n");
702 acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
703 ACPI_REGISTER_PM1_STATUS,
704 (u16)0x800);
705 }
706}
707
708DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_abnormal_poweroff);
709DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_abnormal_poweroff);
710
711#endif
712
685/* 713/*
686 * CardBus controllers have a legacy base address that enables them 714 * CardBus controllers have a legacy base address that enables them
687 * to respond as i82365 pcmcia controllers. We don't want them to 715 * to respond as i82365 pcmcia controllers. We don't want them to
@@ -1174,6 +1202,55 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_
1174DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); 1202DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus );
1175DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); 1203DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus );
1176 1204
1205#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
1206
1207/*
1208 * If we are using libata we can drive this chip properly but must
1209 * do this early on to make the additional device appear during
1210 * the PCI scanning.
1211 */
1212
1213static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev)
1214{
1215 u32 conf;
1216 u8 hdr;
1217
1218 /* Only poke fn 0 */
1219 if (PCI_FUNC(pdev->devfn))
1220 return;
1221
1222 switch(pdev->device) {
1223 case PCI_DEVICE_ID_JMICRON_JMB365:
1224 case PCI_DEVICE_ID_JMICRON_JMB366:
1225 /* Redirect IDE second PATA port to the right spot */
1226 pci_read_config_dword(pdev, 0x80, &conf);
1227 conf |= (1 << 24);
1228 /* Fall through */
1229 pci_write_config_dword(pdev, 0x80, conf);
1230 case PCI_DEVICE_ID_JMICRON_JMB361:
1231 case PCI_DEVICE_ID_JMICRON_JMB363:
1232 pci_read_config_dword(pdev, 0x40, &conf);
1233 /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
1234 /* Set the class codes correctly and then direct IDE 0 */
1235 conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */
1236 conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */
1237 pci_write_config_dword(pdev, 0x40, conf);
1238
1239 /* Reconfigure so that the PCI scanner discovers the
1240 device is now multifunction */
1241
1242 pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
1243 pdev->hdr_type = hdr & 0x7f;
1244 pdev->multifunction = !!(hdr & 0x80);
1245
1246 break;
1247 }
1248}
1249
1250DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn);
1251
1252#endif
1253
1177#ifdef CONFIG_X86_IO_APIC 1254#ifdef CONFIG_X86_IO_APIC
1178static void __init quirk_alder_ioapic(struct pci_dev *pdev) 1255static void __init quirk_alder_ioapic(struct pci_dev *pdev)
1179{ 1256{
@@ -1341,6 +1418,37 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pc
1341DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); 1418DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh);
1342DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); 1419DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh);
1343 1420
1421/*
1422 * Some Intel PCI Express chipsets have trouble with downstream
1423 * device power management.
1424 */
1425static void quirk_intel_pcie_pm(struct pci_dev * dev)
1426{
1427 pci_pm_d3_delay = 120;
1428 dev->no_d1d2 = 1;
1429}
1430
1431DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e2, quirk_intel_pcie_pm);
1432DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e3, quirk_intel_pcie_pm);
1433DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e4, quirk_intel_pcie_pm);
1434DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e5, quirk_intel_pcie_pm);
1435DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e6, quirk_intel_pcie_pm);
1436DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25e7, quirk_intel_pcie_pm);
1437DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f7, quirk_intel_pcie_pm);
1438DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f8, quirk_intel_pcie_pm);
1439DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25f9, quirk_intel_pcie_pm);
1440DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x25fa, quirk_intel_pcie_pm);
1441DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2601, quirk_intel_pcie_pm);
1442DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2602, quirk_intel_pcie_pm);
1443DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2603, quirk_intel_pcie_pm);
1444DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2604, quirk_intel_pcie_pm);
1445DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2605, quirk_intel_pcie_pm);
1446DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2606, quirk_intel_pcie_pm);
1447DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2607, quirk_intel_pcie_pm);
1448DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2608, quirk_intel_pcie_pm);
1449DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm);
1450DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm);
1451DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm);
1344 1452
1345/* 1453/*
1346 * Fixup the cardbus bridges on the IBM Dock II docking station 1454 * Fixup the cardbus bridges on the IBM Dock II docking station
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 622b3f8ba820..f8ae2b7db0a7 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -61,7 +61,7 @@ struct pci_bus * __devinit pci_find_bus(int domain, int busnr)
61 * @from: Previous PCI bus found, or %NULL for new search. 61 * @from: Previous PCI bus found, or %NULL for new search.
62 * 62 *
63 * Iterates through the list of known PCI busses. A new search is 63 * Iterates through the list of known PCI busses. A new search is
64 * initiated by passing %NULL to the @from argument. Otherwise if 64 * initiated by passing %NULL as the @from argument. Otherwise if
65 * @from is not %NULL, searches continue from next device on the 65 * @from is not %NULL, searches continue from next device on the
66 * global list. 66 * global list.
67 */ 67 */
@@ -148,13 +148,14 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
148 * @from: Previous PCI device found in search, or %NULL for new search. 148 * @from: Previous PCI device found in search, or %NULL for new search.
149 * 149 *
150 * Iterates through the list of known PCI devices. If a PCI device is 150 * Iterates through the list of known PCI devices. If a PCI device is
151 * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its 151 * found with a matching @vendor, @device, @ss_vendor and @ss_device, a
152 * device structure is returned. Otherwise, %NULL is returned. 152 * pointer to its device structure is returned. Otherwise, %NULL is returned.
153 * A new search is initiated by passing %NULL to the @from argument. 153 * A new search is initiated by passing %NULL as the @from argument.
154 * Otherwise if @from is not %NULL, searches continue from next device on the global list. 154 * Otherwise if @from is not %NULL, searches continue from next device
155 * on the global list.
155 * 156 *
156 * NOTE: Do not use this function anymore, use pci_get_subsys() instead, as 157 * NOTE: Do not use this function any more; use pci_get_subsys() instead, as
157 * the pci device returned by this function can disappear at any moment in 158 * the PCI device returned by this function can disappear at any moment in
158 * time. 159 * time.
159 */ 160 */
160static struct pci_dev * pci_find_subsys(unsigned int vendor, 161static struct pci_dev * pci_find_subsys(unsigned int vendor,
@@ -191,14 +192,15 @@ exit:
191 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids 192 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
192 * @from: Previous PCI device found in search, or %NULL for new search. 193 * @from: Previous PCI device found in search, or %NULL for new search.
193 * 194 *
194 * Iterates through the list of known PCI devices. If a PCI device is 195 * Iterates through the list of known PCI devices. If a PCI device is found
195 * found with a matching @vendor and @device, a pointer to its device structure is 196 * with a matching @vendor and @device, a pointer to its device structure is
196 * returned. Otherwise, %NULL is returned. 197 * returned. Otherwise, %NULL is returned.
197 * A new search is initiated by passing %NULL to the @from argument. 198 * A new search is initiated by passing %NULL as the @from argument.
198 * Otherwise if @from is not %NULL, searches continue from next device on the global list. 199 * Otherwise if @from is not %NULL, searches continue from next device
200 * on the global list.
199 * 201 *
200 * NOTE: Do not use this function anymore, use pci_get_device() instead, as 202 * NOTE: Do not use this function any more; use pci_get_device() instead, as
201 * the pci device returned by this function can disappear at any moment in 203 * the PCI device returned by this function can disappear at any moment in
202 * time. 204 * time.
203 */ 205 */
204struct pci_dev * 206struct pci_dev *
@@ -215,11 +217,11 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
215 * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids 217 * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids
216 * @from: Previous PCI device found in search, or %NULL for new search. 218 * @from: Previous PCI device found in search, or %NULL for new search.
217 * 219 *
218 * Iterates through the list of known PCI devices. If a PCI device is 220 * Iterates through the list of known PCI devices. If a PCI device is found
219 * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its 221 * with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its
220 * device structure is returned, and the reference count to the device is 222 * device structure is returned, and the reference count to the device is
221 * incremented. Otherwise, %NULL is returned. A new search is initiated by 223 * incremented. Otherwise, %NULL is returned. A new search is initiated by
222 * passing %NULL to the @from argument. Otherwise if @from is not %NULL, 224 * passing %NULL as the @from argument. Otherwise if @from is not %NULL,
223 * searches continue from next device on the global list. 225 * searches continue from next device on the global list.
224 * The reference count for @from is always decremented if it is not %NULL. 226 * The reference count for @from is always decremented if it is not %NULL.
225 */ 227 */
@@ -262,7 +264,7 @@ exit:
262 * found with a matching @vendor and @device, the reference count to the 264 * found with a matching @vendor and @device, the reference count to the
263 * device is incremented and a pointer to its device structure is returned. 265 * device is incremented and a pointer to its device structure is returned.
264 * Otherwise, %NULL is returned. A new search is initiated by passing %NULL 266 * Otherwise, %NULL is returned. A new search is initiated by passing %NULL
265 * to the @from argument. Otherwise if @from is not %NULL, searches continue 267 * as the @from argument. Otherwise if @from is not %NULL, searches continue
266 * from next device on the global list. The reference count for @from is 268 * from next device on the global list. The reference count for @from is
267 * always decremented if it is not %NULL. 269 * always decremented if it is not %NULL.
268 */ 270 */
@@ -279,11 +281,13 @@ pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
279 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids 281 * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
280 * @from: Previous PCI device found in search, or %NULL for new search. 282 * @from: Previous PCI device found in search, or %NULL for new search.
281 * 283 *
282 * Iterates through the list of known PCI devices in the reverse order of pci_find_device(). 284 * Iterates through the list of known PCI devices in the reverse order of
285 * pci_find_device().
283 * If a PCI device is found with a matching @vendor and @device, a pointer to 286 * If a PCI device is found with a matching @vendor and @device, a pointer to
284 * its device structure is returned. Otherwise, %NULL is returned. 287 * its device structure is returned. Otherwise, %NULL is returned.
285 * A new search is initiated by passing %NULL to the @from argument. 288 * A new search is initiated by passing %NULL as the @from argument.
286 * Otherwise if @from is not %NULL, searches continue from previous device on the global list. 289 * Otherwise if @from is not %NULL, searches continue from previous device
290 * on the global list.
287 */ 291 */
288struct pci_dev * 292struct pci_dev *
289pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from) 293pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from)
@@ -317,7 +321,7 @@ exit:
317 * found with a matching @class, the reference count to the device is 321 * found with a matching @class, the reference count to the device is
318 * incremented and a pointer to its device structure is returned. 322 * incremented and a pointer to its device structure is returned.
319 * Otherwise, %NULL is returned. 323 * Otherwise, %NULL is returned.
320 * A new search is initiated by passing %NULL to the @from argument. 324 * A new search is initiated by passing %NULL as the @from argument.
321 * Otherwise if @from is not %NULL, searches continue from next device 325 * Otherwise if @from is not %NULL, searches continue from next device
322 * on the global list. The reference count for @from is always decremented 326 * on the global list. The reference count for @from is always decremented
323 * if it is not %NULL. 327 * if it is not %NULL.