diff options
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 652171706258..4894500a0139 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -160,11 +160,16 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, | |||
160 | if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) | 160 | if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0) |
161 | dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); | 161 | dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n"); |
162 | 162 | ||
163 | plat->mdio_bus_data = devm_kzalloc(&pdev->dev, | 163 | if (plat->phy_bus_name) |
164 | sizeof(struct stmmac_mdio_bus_data), | 164 | plat->mdio_bus_data = NULL; |
165 | GFP_KERNEL); | 165 | else |
166 | 166 | plat->mdio_bus_data = | |
167 | plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); | 167 | devm_kzalloc(&pdev->dev, |
168 | sizeof(struct stmmac_mdio_bus_data), | ||
169 | GFP_KERNEL); | ||
170 | |||
171 | plat->force_sf_dma_mode = | ||
172 | of_property_read_bool(np, "snps,force_sf_dma_mode"); | ||
168 | 173 | ||
169 | /* Set the maxmtu to a default of JUMBO_LEN in case the | 174 | /* Set the maxmtu to a default of JUMBO_LEN in case the |
170 | * parameter is not present in the device tree. | 175 | * parameter is not present in the device tree. |