@@ -115,7 +115,7 @@ static int anarion_dwmac_probe(struct platform_device *pdev)
if (IS_ERR(gmac))
return PTR_ERR(gmac);
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -435,7 +435,7 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
if (IS_ERR(stmmac_res.addr))
return PTR_ERR(stmmac_res.addr);
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -27,7 +27,7 @@ static int dwmac_generic_probe(struct platform_device *pdev)
return ret;
if (pdev->dev.of_node) {
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat)) {
dev_err(&pdev->dev, "dt configuration failed\n");
return PTR_ERR(plat_dat);
@@ -331,7 +331,7 @@ static int imx_dwmac_probe(struct platform_device *pdev)
if (!dwmac)
return -ENOMEM;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -241,7 +241,7 @@ static int ingenic_mac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -84,7 +84,7 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat)) {
dev_err(&pdev->dev, "dt configuration failed\n");
return PTR_ERR(plat_dat);
@@ -384,7 +384,7 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)
if (val)
return val;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -169,7 +169,7 @@ static int ls1x_dwmac_probe(struct platform_device *pdev)
if (!dwmac)
return -ENOMEM;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat),
"dt configuration failed\n");
@@ -37,7 +37,7 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -656,7 +656,7 @@ static int mediatek_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -52,7 +52,7 @@ static int meson6_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -400,7 +400,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -735,7 +735,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
return dev_err_probe(dev, ret,
"Failed to get platform resources\n");
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat)) {
return dev_err_probe(dev, PTR_ERR(plat_dat),
"dt configuration failed\n");
@@ -1824,7 +1824,7 @@ static int rk_gmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -400,7 +400,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -122,7 +122,7 @@ static int starfive_dwmac_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, err,
"failed to get resources\n");
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat),
"dt configuration failed\n");
@@ -273,7 +273,7 @@ static int sti_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -366,7 +366,7 @@ static int stm32_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -1223,7 +1223,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
if (ret)
return -EINVAL;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -108,7 +108,7 @@ static int sun7i_gmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -284,7 +284,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
if (err < 0)
goto disable_clks;
- plat = devm_stmmac_probe_config_dt(pdev, res.mac);
+ plat = devm_stmmac_probe_config_dt(pdev, &res);
if (IS_ERR(plat)) {
err = PTR_ERR(plat);
goto disable_clks;
@@ -220,7 +220,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)
if (ret)
return ret;
- plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+ plat_dat = devm_stmmac_probe_config_dt(pdev, &stmmac_res);
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
@@ -424,13 +424,14 @@ static void stmmac_remove_config_dt(struct platform_device *pdev,
/**
* stmmac_probe_config_dt - parse device-tree driver parameters
* @pdev: platform_device structure
- * @mac: MAC address to use
+ * @res: driver-specific parameters
* Description:
* this function is to read the driver parameters from device-tree and
* set some private fields that will be used by the main at runtime.
*/
static struct plat_stmmacenet_data *
-stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
+stmmac_probe_config_dt(struct platform_device *pdev,
+ struct stmmac_resources *res)
{
struct device_node *np = pdev->dev.of_node;
struct plat_stmmacenet_data *plat;
@@ -443,12 +444,12 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
if (!plat)
return ERR_PTR(-ENOMEM);
- rc = of_get_mac_address(np, mac);
+ rc = of_get_mac_address(np, res->mac);
if (rc) {
if (rc == -EPROBE_DEFER)
return ERR_PTR(rc);
- eth_zero_addr(mac);
+ eth_zero_addr(res->mac);
}
phy_mode = device_get_phy_mode(&pdev->dev);
@@ -677,17 +678,18 @@ static void devm_stmmac_remove_config_dt(void *data)
/**
* devm_stmmac_probe_config_dt
* @pdev: platform_device structure
- * @mac: MAC address to use
+ * @res: driver-specific parameters
* Description: Devres variant of stmmac_probe_config_dt(). Does not require
* the user to call stmmac_remove_config_dt() at driver detach.
*/
struct plat_stmmacenet_data *
-devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
+devm_stmmac_probe_config_dt(struct platform_device *pdev,
+ struct stmmac_resources *res)
{
struct plat_stmmacenet_data *plat;
int ret;
- plat = stmmac_probe_config_dt(pdev, mac);
+ plat = stmmac_probe_config_dt(pdev, res);
if (IS_ERR(plat))
return plat;
@@ -700,7 +702,8 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
}
#else
struct plat_stmmacenet_data *
-devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
+devm_stmmac_probe_config_dt(struct platform_device *pdev,
+ struct stmmac_resources *res)
{
return ERR_PTR(-EINVAL);
}
@@ -12,7 +12,8 @@
#include "stmmac.h"
struct plat_stmmacenet_data *
-devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac);
+devm_stmmac_probe_config_dt(struct platform_device *pdev,
+ struct stmmac_resources *res);
int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res);