net: designware: fix PHY reset with DM_MDIO
authorNeil Armstrong <narmstrong@baylibre.com>
Wed, 21 Apr 2021 08:58:01 +0000 (10:58 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Wed, 28 Apr 2021 15:45:26 +0000 (17:45 +0200)
commit98b8204626ac2837e927e79d3dfe77246e506c02
treeab8ef24fcc5ea2b646e42fb48abb5e10257a0ad8
parent79b0f08d6af498e6fda8cd257d62e2095764410c
net: designware: fix PHY reset with DM_MDIO

The dw_eth_pdata is not accessible from the mdio device, it gets the mdio bus plat
leading to random sleeps (-10174464 on Odroid-HC4).

This moves the dw_mdio_reset function to a common one taking the ethernet
device as parameter and use it from the dw_mdio_reset and dm_mdio variant functions.

Fixes: 5160b4567c ("net: designware: add DM_MDIO support")
Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/designware.c