From: Alexandre Bounine <alexandre.bounine@idt.com>
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Cc: Alexandre Bounine <alexandre.bounine@idt.com>,
Thomas Moll <thomas.moll@sysgo.com>
Subject: [PATCH 5/5] RapidIO: remove mport resource reservation from common RIO code
Date: Mon, 28 Feb 2011 15:51:05 -0500 [thread overview]
Message-ID: <1298926265-5381-6-git-send-email-alexandre.bounine@idt.com> (raw)
In-Reply-To: <1298926265-5381-1-git-send-email-alexandre.bounine@idt.com>
Removes resource reservation from the common sybsystem initialization code
and make it part of mport driver initialization. This resolves conflict
with resource reservation by device specific mport drivers.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
---
arch/powerpc/sysdev/fsl_rio.c | 9 +++++++++
drivers/rapidio/rio.c | 14 +-------------
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 7d35a12..f25ad15 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -1432,6 +1432,14 @@ int fsl_rio_setup(struct platform_device *dev)
port->iores.flags = IORESOURCE_MEM;
port->iores.name = "rio_io_win";
+ if (request_resource(&iomem_resource, &port->iores) < 0) {
+ dev_err(&dev->dev, "RIO: Error requesting master port region"
+ " 0x%016llx-0x%016llx\n",
+ (u64)port->iores.start, (u64)port->iores.end);
+ rc = -ENOMEM;
+ goto err_res;
+ }
+
priv->pwirq = irq_of_parse_and_map(dev->dev.of_node, 0);
priv->bellirq = irq_of_parse_and_map(dev->dev.of_node, 2);
priv->txirq = irq_of_parse_and_map(dev->dev.of_node, 3);
@@ -1536,6 +1544,7 @@ int fsl_rio_setup(struct platform_device *dev)
return 0;
err:
iounmap(priv->regs_win);
+err_res:
kfree(priv);
err_priv:
kfree(port);
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 9a7b216..c29719c 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -1137,20 +1137,9 @@ static int __devinit rio_init(void)
int __devinit rio_init_mports(void)
{
- int rc = 0;
struct rio_mport *port;
list_for_each_entry(port, &rio_mports, node) {
- if (!request_mem_region(port->iores.start,
- resource_size(&port->iores),
- port->name)) {
- printk(KERN_ERR
- "RIO: Error requesting master port region 0x%016llx-0x%016llx\n",
- (u64)port->iores.start, (u64)port->iores.end);
- rc = -ENOMEM;
- goto out;
- }
-
if (port->host_deviceid >= 0)
rio_enum_mport(port);
else
@@ -1159,8 +1148,7 @@ int __devinit rio_init_mports(void)
rio_init();
- out:
- return rc;
+ return 0;
}
device_initcall_sync(rio_init_mports);
--
1.7.3.1
prev parent reply other threads:[~2011-02-28 20:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 20:51 [PATCH 0/5] RapidIO: configuration and initialization changes Alexandre Bounine
2011-02-28 20:51 ` [PATCH 1/5] RapidIO: Add architecture specific callbacks Alexandre Bounine
2011-02-28 20:51 ` [PATCH 2/5] RapidIO: Modify configuration to support PCI-SRIO controller Alexandre Bounine
2011-02-28 20:51 ` [PATCH 3/5] RapidIO: Modify subsystem and driver initialization sequence Alexandre Bounine
2011-02-28 20:51 ` [PATCH 4/5] RapidIO: Modify mport ID assignment Alexandre Bounine
2011-02-28 20:51 ` Alexandre Bounine [this message]
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=1298926265-5381-6-git-send-email-alexandre.bounine@idt.com \
--to=alexandre.bounine@idt.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=thomas.moll@sysgo.com \
/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