net: phy: remove parameter new_link from phy_mac_interrupt()

I see two issues with parameter new_link:

1. It's not needed. See also phy_interrupt(), works w/o this parameter.
   phy_mac_interrupt sets the state to PHY_CHANGELINK and triggers the
   state machine which then calls phy_read_status. And phy_read_status
   updates the link state.

2. phy_mac_interrupt is used in interrupt context and getting the link
   state may sleep (at least when having to access the PHY registers
   via MDIO bus).

So let's remove it.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Heiner Kallweit
2018-01-10 21:21:31 +01:00
committed by David S. Miller
parent febafc8455
commit 28b2e0d2cd
3 changed files with 8 additions and 11 deletions

View File

@@ -1057,16 +1057,12 @@ void phy_state_machine(struct work_struct *work)
/**
* phy_mac_interrupt - MAC says the link has changed
* @phydev: phy_device struct with changed link
* @new_link: Link is Up/Down.
*
* Description: The MAC layer is able indicate there has been a change
* in the PHY link status. Set the new link status, and trigger the
* state machine, work a work queue.
* The MAC layer is able to indicate there has been a change in the PHY link
* status. Trigger the state machine and work a work queue.
*/
void phy_mac_interrupt(struct phy_device *phydev, int new_link)
void phy_mac_interrupt(struct phy_device *phydev)
{
phydev->link = new_link;
/* Trigger a state machine change */
queue_work(system_power_efficient_wq, &phydev->phy_queue);
}