[PATCH V2 7/7] net: stmmac: Overwrite platform data if passed from auxdata

Vipul Kumar Samar vipulkumar.samar at st.com
Fri Jul 13 05:23:54 EDT 2012


Platform data can be passed through either device tree or
auxdata_lookup. Device tree still donot have any means to provide
facility for passing platform callbacks to the driver.

If any platform data is available through auxdata_lookup then overwrite
the platform data passed through device tree.

Signed-off-by: Vipul Kumar Samar <vipulkumar.samar at st.com>
---
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 680d2b8..4651579 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -114,10 +114,11 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 			pr_err("%s: main dt probe failed", __func__);
 			goto out_unmap;
 		}
-	} else {
-		plat_dat = pdev->dev.platform_data;
 	}
 
+	if (pdev->dev.platform_data)
+		plat_dat = pdev->dev.platform_data;
+
 	/* Custom initialisation (if needed)*/
 	if (plat_dat->init) {
 		ret = plat_dat->init(pdev);
-- 
1.7.2.2




More information about the linux-arm-kernel mailing list