From: Matthew Wilcox <willy@debian.org>
To: Matthew Wilcox <willy@debian.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
Andrew Morton <akpm@zip.com.au>, Greg KH <greg@kroah.com>,
David Mosberger <davidm@hpl.hp.com>,
linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org
Subject: [2/3] Use insert_resource in pci_claim_resource
Date: Thu, 18 Mar 2004 23:52:17 +0000 [thread overview]
Message-ID: <20040318235217.GJ25059@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20040318235024.GH25059@parcelfarce.linux.theplanet.co.uk>
On ia64, the parent resources are not necessarily PCI resources and
so won't get found by pci_find_parent_resource. Use the shiny new
insert_resource() function instead, which I think we would have used
here had it been available at the time.
Index: drivers/pci/setup-res.c
=================================RCS file: /var/cvs/linux-2.6/drivers/pci/setup-res.c,v
retrieving revision 1.7
diff -u -p -r1.7 setup-res.c
--- a/drivers/pci/setup-res.c 10 Mar 2004 02:27:48 -0000 1.7
+++ b/drivers/pci/setup-res.c 18 Mar 2004 23:40:56 -0000
@@ -94,13 +94,18 @@ int __init
pci_claim_resource(struct pci_dev *dev, int resource)
{
struct resource *res = &dev->resource[resource];
- struct resource *root = pci_find_parent_resource(dev, res);
+ struct resource *root = NULL;
char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
int err;
+ if (res->flags & IORESOURCE_IO)
+ root = &ioport_resource;
+ if (res->flags & IORESOURCE_MEM)
+ root = &iomem_resource;
+
err = -EINVAL;
if (root != NULL)
- err = request_resource(root, res);
+ err = insert_resource(root, res);
if (err) {
printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n",
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
next prev parent reply other threads:[~2004-03-18 23:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-18 23:50 [0/3] Make pci resources show up in iomem/ioport on ia64 Matthew Wilcox
2004-03-18 23:51 ` [1/3] insert_resource can succeed and return an error Matthew Wilcox
2004-03-18 23:52 ` Matthew Wilcox [this message]
2004-03-19 9:56 ` [2/3] Use insert_resource in pci_claim_resource Russell King
2004-03-19 14:52 ` Matthew Wilcox
2004-03-19 15:36 ` Russell King
2004-03-19 17:09 ` Matthew Wilcox
2004-03-18 23:52 ` [3/3] claim PCI resources on ia64 Matthew Wilcox
2004-03-19 1:48 ` David Mosberger
2004-03-19 22:13 ` [0/3] Make pci resources show up in iomem/ioport " Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040318235217.GJ25059@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=akpm@zip.com.au \
--cc=davidm@hpl.hp.com \
--cc=greg@kroah.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox