Thread (5 messages) flat view 5 messages, 4 authors, 2012-07-31
STALE5159d

[PATCH 3/6] mv643xx.c: Add basic device tree support.

From: Arnaud Patard Rtp <hidden>
Date: 2012-07-31 07:14:54

Ian Molton [off-list ref] writes:
Hi,

[...]
quoted hunk
@@ -2873,7 +2913,31 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	struct resource *res;
 	int err;
 
-	pd = pdev->dev.platform_data;
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_ATOMIC);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			return -ENOMEM;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"port_number", &pd->port_number);
+		of_property_read_u32(pdev->dev.of_node,
+			"phy_addr", &pd->phy_addr);
I guess we need something for tx_csum_limit in the device tree too. It's
important for kirkwood and dove.

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