提交 ec33d71d 编写于 作者: L LABBE Corentin 提交者: David S. Miller

net-next: stmmac: add optional setup function

Instead of adding more ifthen logic for adding a new mac_device_info
setup function, it is easier to add a function pointer to the function
needed.
Signed-off-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 38741918
...@@ -3933,7 +3933,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv) ...@@ -3933,7 +3933,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
struct mac_device_info *mac; struct mac_device_info *mac;
/* Identify the MAC HW device */ /* Identify the MAC HW device */
if (priv->plat->has_gmac) { if (priv->plat->setup) {
mac = priv->plat->setup(priv);
} else if (priv->plat->has_gmac) {
priv->dev->priv_flags |= IFF_UNICAST_FLT; priv->dev->priv_flags |= IFF_UNICAST_FLT;
mac = dwmac1000_setup(priv->ioaddr, mac = dwmac1000_setup(priv->ioaddr,
priv->plat->multicast_filter_bins, priv->plat->multicast_filter_bins,
......
...@@ -177,6 +177,7 @@ struct plat_stmmacenet_data { ...@@ -177,6 +177,7 @@ struct plat_stmmacenet_data {
void (*fix_mac_speed)(void *priv, unsigned int speed); void (*fix_mac_speed)(void *priv, unsigned int speed);
int (*init)(struct platform_device *pdev, void *priv); int (*init)(struct platform_device *pdev, void *priv);
void (*exit)(struct platform_device *pdev, void *priv); void (*exit)(struct platform_device *pdev, void *priv);
struct mac_device_info *(*setup)(void *priv);
void *bsp_priv; void *bsp_priv;
struct clk *stmmac_clk; struct clk *stmmac_clk;
struct clk *pclk; struct clk *pclk;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册