]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
net: stmmac: fix bad merge conflict resolution
[karo-tx-linux.git] / drivers / net / ethernet / stmicro / stmmac / stmmac_platform.c
index da8be6e630961bac8478565741afe03b7b36a046..51c9069ef4052c52caa06333be5927d47bccdf68 100644 (file)
@@ -71,14 +71,23 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
                plat->force_sf_dma_mode = 1;
        }
 
-       dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), GFP_KERNEL);
-       if (!dma_cfg)
-               return -ENOMEM;
-
-       plat->dma_cfg = dma_cfg;
-       of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
-       dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst");
-       dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst");
+       if (of_find_property(np, "snps,pbl", NULL)) {
+               dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
+                                      GFP_KERNEL);
+               if (!dma_cfg)
+                       return -ENOMEM;
+               plat->dma_cfg = dma_cfg;
+               of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
+               dma_cfg->fixed_burst =
+                       of_property_read_bool(np, "snps,fixed-burst");
+               dma_cfg->mixed_burst =
+                       of_property_read_bool(np, "snps,mixed-burst");
+       }
+       plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
+       if (plat->force_thresh_dma_mode) {
+               plat->force_sf_dma_mode = 0;
+               pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set.");
+       }
 
        return 0;
 }
@@ -113,7 +122,7 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
        if (IS_ERR(addr))
                return PTR_ERR(addr);
 
-       plat_dat = pdev->dev.platform_data;
+       plat_dat = dev_get_platdata(&pdev->dev);
        if (pdev->dev.of_node) {
                if (!plat_dat)
                        plat_dat = devm_kzalloc(&pdev->dev,