|
@@ -148,6 +148,14 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
|
|
|
/* If we find a phy-handle property, use it as the PHY */
|
|
/* If we find a phy-handle property, use it as the PHY */
|
|
|
plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
|
plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
|
|
|
|
|
|
|
|
|
+ /* If phy-handle is not specified, check if we have a fixed-phy */
|
|
|
|
|
+ if (!plat->phy_node && of_phy_is_fixed_link(np)) {
|
|
|
|
|
+ if ((of_phy_register_fixed_link(np) < 0))
|
|
|
|
|
+ return -ENODEV;
|
|
|
|
|
+
|
|
|
|
|
+ plat->phy_node = of_node_get(np);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/* "snps,phy-addr" is not a standard property. Mark it as deprecated
|
|
/* "snps,phy-addr" is not a standard property. Mark it as deprecated
|
|
|
* and warn of its use. Remove this when phy node support is added.
|
|
* and warn of its use. Remove this when phy node support is added.
|
|
|
*/
|
|
*/
|
|
@@ -212,8 +220,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
|
|
|
if (of_find_property(np, "snps,pbl", NULL)) {
|
|
if (of_find_property(np, "snps,pbl", NULL)) {
|
|
|
dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
|
|
dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
|
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
|
- if (!dma_cfg)
|
|
|
|
|
|
|
+ if (!dma_cfg) {
|
|
|
|
|
+ of_node_put(np);
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
+ }
|
|
|
plat->dma_cfg = dma_cfg;
|
|
plat->dma_cfg = dma_cfg;
|
|
|
of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
|
|
of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
|
|
|
dma_cfg->fixed_burst =
|
|
dma_cfg->fixed_burst =
|