Thread (9 messages) flat view 9 messages, 5 authors, 2012-03-15

Re: [PATCH] stmmac: Add device-tree support

From: Stefan Roese <sr@denx.de>
Date: 2012-03-12 15:25:50
Also in: linux-arm-kernel, netdev

On Monday 12 March 2012 15:38:25 Jean-Christophe PLAGNIOL-VILLARD wrote:
quoted
@@ -58,6 +94,22 @@ static int stmmac_pltfr_probe(struct platform_device
*pdev)

 		ret = -ENOMEM;
 		goto out_release_region;
 	
 	}

+
+#ifdef CONFIG_OF
+	plat_dat = devm_kzalloc(&pdev->dev, sizeof(struct
plat_stmmacenet_data), +				GFP_KERNEL);
+	if (!plat_dat) {
+		pr_err("%s: ERROR: no memory", __func__);
+		ret = -ENOMEM;
+		goto out_unmap;
+	}
+
+	ret = stmmac_probe_config_dt(pdev, plat_dat, &mac);
+	if (ret) {
+		pr_err("%s: main dt probe failed", __func__);
+		goto out_unmap;
+	}
+#else
This must be check at runtime, we can boot a kernel with or without DT.
Are you referring to using "if (pdev->dev.of_node)" to distinguish between DT 
and non-DT version instead of this #ifdef?

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