]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: phy: simplify phy_mac_interrupt and related functions
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 9 Nov 2018 17:56:52 +0000 (18:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Nov 2018 17:41:32 +0000 (09:41 -0800)
When using phy_mac_interrupt() the irq number is set to
PHY_IGNORE_INTERRUPT, therefore phy_interrupt_is_valid() returns false.
As a result phy_change() effectively just calls phy_trigger_machine()
when called from phy_mac_interrupt() via phy_change_work(). So we can
call phy_trigger_machine() from phy_mac_interrupt() directly and
remove some now unneeded code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
include/linux/phy.h

index da41420dfd11a3cd99a7aa57b5baa586294db9bd..ce1e8130a38f1cdbdd865df9648422fa51961fb1 100644 (file)
@@ -750,18 +750,6 @@ static irqreturn_t phy_change(struct phy_device *phydev)
        return IRQ_NONE;
 }
 
-/**
- * phy_change_work - Scheduled by the phy_mac_interrupt to handle PHY changes
- * @work: work_struct that describes the work to be done
- */
-void phy_change_work(struct work_struct *work)
-{
-       struct phy_device *phydev =
-               container_of(work, struct phy_device, phy_queue);
-
-       phy_change(phydev);
-}
-
 /**
  * phy_interrupt - PHY interrupt handler
  * @irq: interrupt line
@@ -1005,7 +993,7 @@ void phy_state_machine(struct work_struct *work)
 void phy_mac_interrupt(struct phy_device *phydev)
 {
        /* Trigger a state machine change */
-       queue_work(system_power_efficient_wq, &phydev->phy_queue);
+       phy_trigger_machine(phydev);
 }
 EXPORT_SYMBOL(phy_mac_interrupt);
 
index 00a46218c3a22160d5739a375ca4ec4693cf932b..0f56d408b0332595bed1cfd7291e053c0e4f2f38 100644 (file)
@@ -587,7 +587,6 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
 
        mutex_init(&dev->lock);
        INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
-       INIT_WORK(&dev->phy_queue, phy_change_work);
 
        /* Request the appropriate module unconditionally; don't
         * bother trying to do so only if it isn't already loaded,
index 7db07e69c88f615decbec4b581c4309cd87d8ae7..17d1f64723e48af14c93b37ae2777c2bd2d49d27 100644 (file)
@@ -369,7 +369,6 @@ struct phy_c45_device_ids {
  * giving up on the current attempt at acquiring a link
  * irq: IRQ number of the PHY's interrupt (-1 if none)
  * phy_timer: The timer for handling the state machine
- * phy_queue: A work_queue for the phy_mac_interrupt
  * attached_dev: The attached enet driver's device instance ptr
  * adjust_link: Callback for the enet controller to respond to
  * changes in the link state.
@@ -454,7 +453,6 @@ struct phy_device {
        void *priv;
 
        /* Interrupt and Polling infrastructure */
-       struct work_struct phy_queue;
        struct delayed_work state_queue;
 
        struct mutex lock;
@@ -1029,7 +1027,6 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
 int phy_drivers_register(struct phy_driver *new_driver, int n,
                         struct module *owner);
 void phy_state_machine(struct work_struct *work);
-void phy_change_work(struct work_struct *work);
 void phy_mac_interrupt(struct phy_device *phydev);
 void phy_start_machine(struct phy_device *phydev);
 void phy_stop_machine(struct phy_device *phydev);