net: ethernet: dwmac-sun8i: Use the correct function in exit path
authorCorentin Labbe <clabbe@baylibre.com>
Sun, 10 Nov 2019 11:30:48 +0000 (11:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:45:18 +0000 (18:45 +0100)
commit29dcbbb5ab0ac181f239c80106b97e6118e96475
treee4e19be38b1f81d32ff290485602cc928a694d05
parentbdae2f7b2031cbeebca93267bef5e829e55c03ca
net: ethernet: dwmac-sun8i: Use the correct function in exit path

commit 40a1dcee2d1846a24619fe9ca45c661ca0db7dda upstream.

When PHY is not powered, the probe function fail and some resource are
still unallocated.
Furthermore some BUG happens:
dwmac-sun8i 5020000.ethernet: EMAC reset timeout
------------[ cut here ]------------
kernel BUG at /linux-next/net/core/dev.c:9844!

So let's use the right function (stmmac_pltfr_remove) in the error path.

Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
Cc: <stable@vger.kernel.org> # v4.15+
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c