Thread (3 messages) 3 messages, 2 authors, 2010-02-02

Re: [PATCH 1/1 V5] net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver

From: David Miller <davem@davemloft.net>
Date: 2010-02-02 15:31:09

From: Kristoffer Glembo <redacted>
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help