Thread (14 messages) 14 messages, 5 authors, 2008-07-18

Re: [PATCH 2/2] fs_enet: MDIO on GPIO support

From: Scott Wood <hidden>
Date: 2008-06-16 16:34:26
Also in: linuxppc-dev

On Mon, Jun 16, 2008 at 10:57:02AM +0200, Laurent Pinchart wrote:
On Monday 26 May 2008 11:53, Laurent Pinchart wrote:
quoted
Port the fs_enet driver to support the MDIO on GPIO driver for PHY access
in addition to the mii-bitbang driver.
Now that 1/2 has been applied by Jeff, could this one make it to 
powerpc-next ?
This patch should probably go through Jeff as well...

Acked-by: Scott Wood <redacted>
quoted
-	data = of_get_property(phynode, "reg", &len);
-	if (!data || len != 4)
-		goto out_put_mdio;
+	bus_id = of_get_gpio(mdionode, 0);
+	if (bus_id < 0) {
+		struct resource res;
+		ret = of_address_to_resource(mdionode, 0, &res);
+		if (ret)
+			goto out_put_mdio;
+		bus_id = res.start;
+	}
 
-	snprintf(fpi->bus_id, 16, "%x:%02x", res.start, *data);
+	snprintf(fpi->bus_id, 16, "%x:%02x", bus_id, *data);
It'd be nice if this sort of thing could be moved to phylib, so the latter
could simply be passed a device node (in addition to current mechanisms for
the benefit of unfortunate device-tree-less architectures).

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help