[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1332136129-14010-2-git-send-email-yinghai@kernel.org>
Date: Sun, 18 Mar 2012 22:48:24 -0700
From: Yinghai Lu <yinghai@...nel.org>
To: Jesse Barnes <jbarnes@...tuousgeek.org>, x86 <x86@...nel.org>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Yinghai Lu <yinghai@...nel.org>
Subject: [PATCH -v2 01/26] PCI: Add pci_dev_resource_n()
Prepare to use it with addon_resource and for_each_resource macro.
Signed-off-by: Yinghai Lu <yinghai@...nel.org>
---
drivers/pci/probe.c | 10 ++++++++++
include/linux/pci.h | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index d626c4e..87e87b5 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -75,6 +75,16 @@ static int __init pcibus_class_init(void)
}
postcore_initcall(pcibus_class_init);
+struct resource *pci_dev_resource_n(struct pci_dev *dev, int n)
+{
+ struct pci_dev_addon_resource *addon_res;
+
+ if (n < PCI_NUM_RESOURCES)
+ return &dev->resource[n];
+
+ return NULL;
+}
+
static u64 pci_size(u64 base, u64 maxbase, u64 mask)
{
u64 size = mask & maxbase; /* Find the significant bits */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 161f6c0..bb81080 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -347,6 +347,8 @@ struct pci_dev {
#endif
};
+struct resource *pci_dev_resource_n(struct pci_dev *dev, int n);
+
static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
{
#ifdef CONFIG_PCI_IOV
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists