mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 17:31:37 -04:00
net: stmmac: make the pcs_lynx cleanup sequence specific to dwmac_socfpga
So far, only the dwmac_socfpga variant of stmmac uses PCS Lynx. Use a
dedicated cleanup sequence for dwmac_socfpga instead of using the
generic stmmac one.
Fixes: 5d1f3fe7d2 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver")
Suggested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
fae555f5a5
commit
a8dd7404c2
@@ -16,7 +16,6 @@
|
||||
#include <linux/stmmac.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/pcs/pcs-xpcs.h>
|
||||
#include <linux/pcs-lynx.h>
|
||||
#include <linux/module.h>
|
||||
#if IS_ENABLED(CONFIG_VLAN_8021Q)
|
||||
#define STMMAC_VLAN_TAG_USED
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <linux/phy.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mdio/mdio-regmap.h>
|
||||
#include <linux/pcs-lynx.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/stmmac.h>
|
||||
|
||||
@@ -494,6 +495,17 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void socfpga_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
struct phylink_pcs *pcs = priv->hw->lynx_pcs;
|
||||
|
||||
stmmac_pltfr_remove(pdev);
|
||||
|
||||
lynx_pcs_destroy(pcs);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int socfpga_dwmac_resume(struct device *dev)
|
||||
{
|
||||
@@ -565,7 +577,7 @@ MODULE_DEVICE_TABLE(of, socfpga_dwmac_match);
|
||||
|
||||
static struct platform_driver socfpga_dwmac_driver = {
|
||||
.probe = socfpga_dwmac_probe,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.remove_new = socfpga_dwmac_remove,
|
||||
.driver = {
|
||||
.name = "socfpga-dwmac",
|
||||
.pm = &socfpga_dwmac_pm_ops,
|
||||
|
||||
@@ -665,9 +665,6 @@ int stmmac_mdio_unregister(struct net_device *ndev)
|
||||
if (priv->hw->xpcs)
|
||||
xpcs_destroy(priv->hw->xpcs);
|
||||
|
||||
if (priv->hw->lynx_pcs)
|
||||
lynx_pcs_destroy(priv->hw->lynx_pcs);
|
||||
|
||||
mdiobus_unregister(priv->mii);
|
||||
priv->mii->priv = NULL;
|
||||
mdiobus_free(priv->mii);
|
||||
|
||||
Reference in New Issue
Block a user