From: David Miller <davem@davemloft.net>
To: kristoffer@gaisler.com
Cc: netdev@vger.kernel.org, shemminger@vyatta.com
Subject: Re: [PATCH 1/1 V5] net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver
Date: Tue, 02 Feb 2010 07:31:22 -0800 (PST) [thread overview]
Message-ID: <20100202.073122.120457083.davem@davemloft.net> (raw)
In-Reply-To: <1264664629-25128-2-git-send-email-kristoffer@gaisler.com>
From: Kristoffer Glembo <kristoffer@gaisler.com>
Date: Thu, 28 Jan 2010 08:43:49 +0100
> + struct amba_prom_registers *prom_regs;
> + unsigned int addr;
...
> + irqs = (int *) of_get_property(ofdev->node, "interrupts", NULL);
> + prom_regs = (struct amba_prom_registers *) of_get_property(ofdev->node, "reg", NULL);
...
> + addr = prom_regs->phys_addr;
...
> +struct amba_prom_registers {
> + unsigned int phys_addr;
> + unsigned int reg_size;
> +};
These kinds of constructs should never be necessary in an OF driver.
The device probing layer calculates OF device resources that you can
use to obtain the register (op->resource[]) and IRQ (op->irq[])
mappings portably.
And you use of_ioremap() on the resource object to map the register
I/O space properly, and of_iounmap() it on unload.
See drivers/net/niu.c:niu_of_probe() for an example.
Please fix this up, thank you.
prev parent reply other threads:[~2010-02-02 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-28 7:43 [PATCH 0/1 V5] net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver Kristoffer Glembo
2010-01-28 7:43 ` [PATCH 1/1 " Kristoffer Glembo
2010-02-02 15:31 ` David Miller [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=20100202.073122.120457083.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kristoffer@gaisler.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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;
as well as URLs for NNTP newsgroup(s).