|
@@ -1312,6 +1312,7 @@ static void gfar_init_addr_hash_table(struct gfar_private *priv)
|
|
*/
|
|
*/
|
|
static int gfar_probe(struct platform_device *ofdev)
|
|
static int gfar_probe(struct platform_device *ofdev)
|
|
{
|
|
{
|
|
|
|
+ struct device_node *np = ofdev->dev.of_node;
|
|
struct net_device *dev = NULL;
|
|
struct net_device *dev = NULL;
|
|
struct gfar_private *priv = NULL;
|
|
struct gfar_private *priv = NULL;
|
|
int err = 0, i;
|
|
int err = 0, i;
|
|
@@ -1462,6 +1463,8 @@ static int gfar_probe(struct platform_device *ofdev)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
register_fail:
|
|
register_fail:
|
|
|
|
+ if (of_phy_is_fixed_link(np))
|
|
|
|
+ of_phy_deregister_fixed_link(np);
|
|
unmap_group_regs(priv);
|
|
unmap_group_regs(priv);
|
|
gfar_free_rx_queues(priv);
|
|
gfar_free_rx_queues(priv);
|
|
gfar_free_tx_queues(priv);
|
|
gfar_free_tx_queues(priv);
|
|
@@ -1474,11 +1477,16 @@ register_fail:
|
|
static int gfar_remove(struct platform_device *ofdev)
|
|
static int gfar_remove(struct platform_device *ofdev)
|
|
{
|
|
{
|
|
struct gfar_private *priv = platform_get_drvdata(ofdev);
|
|
struct gfar_private *priv = platform_get_drvdata(ofdev);
|
|
|
|
+ struct device_node *np = ofdev->dev.of_node;
|
|
|
|
|
|
of_node_put(priv->phy_node);
|
|
of_node_put(priv->phy_node);
|
|
of_node_put(priv->tbi_node);
|
|
of_node_put(priv->tbi_node);
|
|
|
|
|
|
unregister_netdev(priv->ndev);
|
|
unregister_netdev(priv->ndev);
|
|
|
|
+
|
|
|
|
+ if (of_phy_is_fixed_link(np))
|
|
|
|
+ of_phy_deregister_fixed_link(np);
|
|
|
|
+
|
|
unmap_group_regs(priv);
|
|
unmap_group_regs(priv);
|
|
gfar_free_rx_queues(priv);
|
|
gfar_free_rx_queues(priv);
|
|
gfar_free_tx_queues(priv);
|
|
gfar_free_tx_queues(priv);
|