|
@@ -529,16 +529,6 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
|
|
|
return bsp_priv;
|
|
|
}
|
|
|
|
|
|
-static void *rk3288_gmac_setup(struct platform_device *pdev)
|
|
|
-{
|
|
|
- return rk_gmac_setup(pdev, &rk3288_ops);
|
|
|
-}
|
|
|
-
|
|
|
-static void *rk3368_gmac_setup(struct platform_device *pdev)
|
|
|
-{
|
|
|
- return rk_gmac_setup(pdev, &rk3368_ops);
|
|
|
-}
|
|
|
-
|
|
|
static int rk_gmac_init(struct platform_device *pdev, void *priv)
|
|
|
{
|
|
|
struct rk_priv_data *bsp_priv = priv;
|
|
@@ -580,7 +570,7 @@ static int rk_gmac_probe(struct platform_device *pdev)
|
|
|
{
|
|
|
struct plat_stmmacenet_data *plat_dat;
|
|
|
struct stmmac_resources stmmac_res;
|
|
|
- const struct stmmac_of_data *data;
|
|
|
+ const struct rk_gmac_ops *data;
|
|
|
int ret;
|
|
|
|
|
|
data = of_device_get_match_data(&pdev->dev);
|
|
@@ -598,12 +588,11 @@ static int rk_gmac_probe(struct platform_device *pdev)
|
|
|
return PTR_ERR(plat_dat);
|
|
|
|
|
|
plat_dat->has_gmac = true;
|
|
|
- plat_dat->setup = data->setup;
|
|
|
plat_dat->init = rk_gmac_init;
|
|
|
plat_dat->exit = rk_gmac_exit;
|
|
|
plat_dat->fix_mac_speed = rk_fix_speed;
|
|
|
|
|
|
- plat_dat->bsp_priv = plat_dat->setup(pdev);
|
|
|
+ plat_dat->bsp_priv = rk_gmac_setup(pdev, data);
|
|
|
if (IS_ERR(plat_dat->bsp_priv))
|
|
|
return PTR_ERR(plat_dat->bsp_priv);
|
|
|
|
|
@@ -614,17 +603,9 @@ static int rk_gmac_probe(struct platform_device *pdev)
|
|
|
return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
|
|
|
}
|
|
|
|
|
|
-static const struct stmmac_of_data rk3288_gmac_data = {
|
|
|
- .setup = rk3288_gmac_setup,
|
|
|
-};
|
|
|
-
|
|
|
-static const struct stmmac_of_data rk3368_gmac_data = {
|
|
|
- .setup = rk3368_gmac_setup,
|
|
|
-};
|
|
|
-
|
|
|
static const struct of_device_id rk_gmac_dwmac_match[] = {
|
|
|
- { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_gmac_data},
|
|
|
- { .compatible = "rockchip,rk3368-gmac", .data = &rk3368_gmac_data},
|
|
|
+ { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_ops },
|
|
|
+ { .compatible = "rockchip,rk3368-gmac", .data = &rk3368_ops },
|
|
|
{ }
|
|
|
};
|
|
|
MODULE_DEVICE_TABLE(of, rk_gmac_dwmac_match);
|