Skip to content

Commit

Permalink
net: phy: remove states PHY_STARTING and PHY_PENDING
Browse files Browse the repository at this point in the history
Both states aren't used. Most likely they result from an idea that
never materialized. So remove them.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Nov 11, 2018
1 parent b08794a commit 899a3cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
7 changes: 0 additions & 7 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ static const char *phy_state_to_str(enum phy_state st)
{
switch (st) {
PHY_STATE_STR(DOWN)
PHY_STATE_STR(STARTING)
PHY_STATE_STR(READY)
PHY_STATE_STR(PENDING)
PHY_STATE_STR(UP)
PHY_STATE_STR(RUNNING)
PHY_STATE_STR(NOLINK)
Expand Down Expand Up @@ -852,9 +850,6 @@ void phy_start(struct phy_device *phydev)
mutex_lock(&phydev->lock);

switch (phydev->state) {
case PHY_STARTING:
phydev->state = PHY_PENDING;
break;
case PHY_READY:
phydev->state = PHY_UP;
break;
Expand Down Expand Up @@ -902,9 +897,7 @@ void phy_state_machine(struct work_struct *work)

switch (phydev->state) {
case PHY_DOWN:
case PHY_STARTING:
case PHY_READY:
case PHY_PENDING:
break;
case PHY_UP:
needs_aneg = true;
Expand Down
22 changes: 2 additions & 20 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,29 +270,13 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
* DOWN: PHY device and driver are not ready for anything. probe
* should be called if and only if the PHY is in this state,
* given that the PHY device exists.
* - PHY driver probe function will, depending on the PHY, set
* the state to STARTING or READY
*
* STARTING: PHY device is coming up, and the ethernet driver is
* not ready. PHY drivers may set this in the probe function.
* If they do, they are responsible for making sure the state is
* eventually set to indicate whether the PHY is UP or READY,
* depending on the state when the PHY is done starting up.
* - PHY driver will set the state to READY
* - start will set the state to PENDING
* - PHY driver probe function will set the state to READY
*
* READY: PHY is ready to send and receive packets, but the
* controller is not. By default, PHYs which do not implement
* probe will be set to this state by phy_probe(). If the PHY
* driver knows the PHY is ready, and the PHY state is STARTING,
* then it sets this STATE.
* probe will be set to this state by phy_probe().
* - start will set the state to UP
*
* PENDING: PHY device is coming up, but the ethernet driver is
* ready. phy_start will set this state if the PHY state is
* STARTING.
* - PHY driver will set the state to UP when the PHY is ready
*
* UP: The PHY and attached device are ready to do work.
* Interrupts should be started here.
* - timer moves to NOLINK or RUNNING
Expand Down Expand Up @@ -329,9 +313,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
*/
enum phy_state {
PHY_DOWN = 0,
PHY_STARTING,
PHY_READY,
PHY_PENDING,
PHY_UP,
PHY_RUNNING,
PHY_NOLINK,
Expand Down

0 comments on commit 899a3cb

Please sign in to comment.