]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: ethernet: davinci_emac: Fix Unbalanced pm_runtime_enable
authorNeil Armstrong <narmstrong@baylibre.com>
Wed, 20 Apr 2016 08:56:13 +0000 (10:56 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 15 Jun 2016 20:29:25 +0000 (21:29 +0100)
commit 99164f9e62a391b5f4b7923b624d182b5d2859e0 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: 3ba97381343b ("net: ethernet: davinci_emac: add pm_runtime support")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/ti/davinci_emac.c

index 35a139e9a833520a195d16a7c620d423638eb90c..a6cfd090c72bf0f47049c3104534d0d29d201137 100644 (file)
@@ -2033,6 +2033,7 @@ static int davinci_emac_remove(struct platform_device *pdev)
        cpdma_ctlr_destroy(priv->dma);
 
        unregister_netdev(ndev);
+       pm_runtime_disable(&pdev->dev);
        free_netdev(ndev);
 
        return 0;