summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
diff options
context:
space:
mode:
authorJoachim Eastwood2015-07-29 00:08:58 +0200
committerDavid S. Miller2015-07-29 09:13:24 +0200
commit149adedd7696cbcf1d72d143ca181334000d0ee7 (patch)
tree8062f245b8059b204b6c29c52739648cfd3b44d4 /drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
parentstmmac: move stmmac_pltfr_probe into dwmac-generic (diff)
downloadkernel-qcow2-linux-149adedd7696cbcf1d72d143ca181334000d0ee7.tar.gz
kernel-qcow2-linux-149adedd7696cbcf1d72d143ca181334000d0ee7.tar.xz
kernel-qcow2-linux-149adedd7696cbcf1d72d143ca181334000d0ee7.zip
stmmac: let dwmac-* drivers handle their own match data
Since only a few of the dwmac-* drivers actually need to use the OF match move handling into the dwmac-* drivers that need it. This will also allow dwmac-* drivers to use their own custom match data structure. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 21193a73acfc..65c1e1afe6a8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -580,8 +580,15 @@ 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;
int ret;
+ data = of_device_get_match_data(&pdev->dev);
+ if (!data) {
+ dev_err(&pdev->dev, "no of match data provided\n");
+ return -EINVAL;
+ }
+
ret = stmmac_get_platform_resources(pdev, &stmmac_res);
if (ret)
return ret;
@@ -591,6 +598,7 @@ 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;