lkml.org 
[lkml]   [2012]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -v2 22/26] PCI: Update pci_resource_bar() to support addon_resource
Date
need to loop addon resource list to retrieve reg_addr in it.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/pci/pci.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5439033..8b9acf6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3549,6 +3549,13 @@ int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type)
reg = pci_iov_resource_bar(dev, resno, type);
if (reg)
return reg;
+ } else if (resno >= PCI_NUM_RESOURCES) {
+ struct resource *res = pci_dev_resource_n(dev, resno);
+
+ if (res) {
+ *type = pci_bar_unknown;
+ return to_pci_dev_addon_resource(res)->reg_addr;
+ }
}

dev_err(&dev->dev, "BAR %d: invalid resource\n", resno);
--
1.7.7


\
 
 \ /
  Last update: 2012-03-19 06:53    [W:0.075 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site