|
@@ -92,8 +92,10 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
|
|
|
if (IS_ERR(addr))
|
|
|
return PTR_ERR(addr);
|
|
|
|
|
|
+ plat_dat = pdev->dev.platform_data;
|
|
|
if (pdev->dev.of_node) {
|
|
|
- plat_dat = devm_kzalloc(&pdev->dev,
|
|
|
+ if (!plat_dat)
|
|
|
+ plat_dat = devm_kzalloc(&pdev->dev,
|
|
|
sizeof(struct plat_stmmacenet_data),
|
|
|
GFP_KERNEL);
|
|
|
if (!plat_dat) {
|
|
@@ -106,8 +108,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
|
|
|
pr_err("%s: main dt probe failed", __func__);
|
|
|
return ret;
|
|
|
}
|
|
|
- } else {
|
|
|
- plat_dat = pdev->dev.platform_data;
|
|
|
}
|
|
|
|
|
|
/* Custom initialisation (if needed)*/
|