Commit edc15924 authored by Neil Armstrong's avatar Neil Armstrong Committed by Ben Hutchings

net: ethernet: davinci_emac: Fix Unbalanced pm_runtime_enable

commit 99164f9e upstream.

In order to avoid an Unbalanced pm_runtime_enable in the DaVinci
emac driver when the device is removed and re-probed, and a
pm_runtime_disable() call in davinci_emac_remove().

Actually, using unbind/bind on a TI DM8168 SoC gives :
$ echo 4a120000.ethernet > /sys/bus/platform/drivers/davinci_emac/unbind
net eth1: DaVinci EMAC: davinci_emac_remove()
$ echo 4a120000.ethernet > /sys/bus/platform/drivers/davinci_emac/bind
davinci_emac 4a120000.ethernet: Unbalanced pm_runtime_enable

Cc: Brian Hutchinson <b.hutchman@gmail.com>
Fixes: 3ba97381 ("net: ethernet: davinci_emac: add pm_runtime support")
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 0fbf8e13
...@@ -2033,6 +2033,7 @@ static int davinci_emac_remove(struct platform_device *pdev) ...@@ -2033,6 +2033,7 @@ static int davinci_emac_remove(struct platform_device *pdev)
cpdma_ctlr_destroy(priv->dma); cpdma_ctlr_destroy(priv->dma);
unregister_netdev(ndev); unregister_netdev(ndev);
pm_runtime_disable(&pdev->dev);
free_netdev(ndev); free_netdev(ndev);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment