From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: AT91: Convert WDT driver to be independent of processor base-address
Date: Wed, 4 May 2011 22:12:29 +0100 [thread overview]
Message-ID: <20110504211229.GA31808@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1304110090.14210.2.camel@redbox>
On Fri, Apr 29, 2011 at 10:48:10PM +0200, Andrew Victor wrote:
> @@ -248,11 +250,17 @@ static struct miscdevice at91wdt_miscdev = {
>
> static int __init at91wdt_probe(struct platform_device *pdev)
> {
> + struct resource *r;
> int res;
>
> + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!r)
> + return -ENODEV;
> +
> if (at91wdt_miscdev.parent)
> return -EBUSY;
> at91wdt_miscdev.parent = &pdev->dev;
> + at91wdt_private.regbase = (void __force __iomem *) r->start;
Passing virtual addresses through iomem resources really isn't nice - they
get added to the resource tree as bus addresses, which actually being
virtual addresses can conflict with real bus addresses.
The proper way to handle this is like every other platform driver, and to
use ioremap() on the resource to obtain a virtual mapping for the device.
If you wish to reuse your fixed io mapping, then override ioremap() in
a similar way to OMAP and arrange for bus addresses in the fixed io
mapping to return an appropriate iomem pointer for those.
next prev parent reply other threads:[~2011-05-04 21:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 20:48 AT91: Convert WDT driver to be independent of processor base-address Andrew Victor
2011-05-04 20:42 ` Ryan Mallon
2011-05-04 21:12 ` Russell King - ARM Linux [this message]
2011-05-05 10:00 ` Jean-Christophe PLAGNIOL-VILLARD
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=20110504211229.GA31808@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).