aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 623ebc50fe6b..7a0072003f34 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -71,19 +71,22 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
71 plat->force_sf_dma_mode = 1; 71 plat->force_sf_dma_mode = 1;
72 } 72 }
73 73
74 dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), GFP_KERNEL); 74 if (of_find_property(np, "snps,pbl", NULL)) {
75 if (!dma_cfg) 75 dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
76 return -ENOMEM; 76 GFP_KERNEL);
77 77 if (!dma_cfg)
78 plat->dma_cfg = dma_cfg; 78 return -ENOMEM;
79 of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); 79 plat->dma_cfg = dma_cfg;
80 dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst"); 80 of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
81 dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); 81 dma_cfg->fixed_burst =
82 of_property_read_bool(np, "snps,fixed-burst");
83 dma_cfg->mixed_burst =
84 of_property_read_bool(np, "snps,mixed-burst");
85 }
82 plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode"); 86 plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
83 if (plat->force_thresh_dma_mode) { 87 if (plat->force_thresh_dma_mode) {
84 plat->force_sf_dma_mode = 0; 88 plat->force_sf_dma_mode = 0;
85 pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set."); 89 pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set.");
86 }
87 90
88 return 0; 91 return 0;
89} 92}