Skip to content
Commit 8f7e8762 authored by Michael Walle's avatar Michael Walle Committed by David S. Miller
Browse files

net: phy: at803x: fix probe error if copper page is selected



The commit c329e5af ("net: phy: at803x: select correct page on
config init") selects the copper page during probe. This fails if the
copper page was already selected. In this case, the value of the copper
page (which is 1) is propagated through phy_restore_page() and is
finally returned for at803x_probe(). Fix it, by just using the
at803x_page_write() directly.

Also in case of an error, the regulator is not disabled and leads to a
WARN_ON() when the probe fails. This couldn't happen before, because
at803x_parse_dt() was the last call in at803x_probe(). It is hard to
see, that the parse_dt() actually enables the regulator. Thus move the
regulator_enable() to the probe function and undo it in case of an
error.

Fixes: c329e5af ("net: phy: at803x: select correct page on config init")
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarDavid Bauer <mail@david-bauer.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55cdc26a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment