Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a05d7dfc authored by Timur Tabi's avatar Timur Tabi Committed by David S. Miller
Browse files

net: phy: at803x: only the AT8030 needs a hardware reset on link change



Commit 13a56b44 ("at803x: Add support for hardware reset") added a
work-around for a hardware bug on the AT8030.  However, the work-around
was being called for all 803x PHYs, even those that don't need it.
Function at803x_link_change_notify() checks to make sure that it only
resets the PHY on the 8030, but it makes more sense to not call that
function at all if it isn't needed.

Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 956a7ffe
Loading
Loading
Loading
Loading
+18 −22
Original line number Diff line number Diff line
@@ -359,7 +359,6 @@ static void at803x_link_change_notify(struct phy_device *phydev)
	 * in the FIFO. In such cases, the FIFO enters an error mode it
	 * cannot recover from by software.
	 */
	if (phydev->drv->phy_id == ATH8030_PHY_ID) {
	if (phydev->state == PHY_NOLINK) {
		if (priv->gpiod_reset && !priv->phy_reset) {
			struct at803x_context context;
@@ -381,7 +380,6 @@ static void at803x_link_change_notify(struct phy_device *phydev)
		priv->phy_reset = false;
	}
}
}

static struct phy_driver at803x_driver[] = {
{
@@ -391,7 +389,6 @@ static struct phy_driver at803x_driver[] = {
	.phy_id_mask		= 0xffffffef,
	.probe			= at803x_probe,
	.config_init		= at803x_config_init,
	.link_change_notify	= at803x_link_change_notify,
	.set_wol		= at803x_set_wol,
	.get_wol		= at803x_get_wol,
	.suspend		= at803x_suspend,
@@ -427,7 +424,6 @@ static struct phy_driver at803x_driver[] = {
	.phy_id_mask		= 0xffffffef,
	.probe			= at803x_probe,
	.config_init		= at803x_config_init,
	.link_change_notify	= at803x_link_change_notify,
	.set_wol		= at803x_set_wol,
	.get_wol		= at803x_get_wol,
	.suspend		= at803x_suspend,