Skip to content

Commit d73a215

Browse files
hkallweitdavem330
authored andcommitted
net: phy: simplify phy_mac_interrupt and related functions
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8deeb63 commit d73a215

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

drivers/net/phy/phy.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -750,18 +750,6 @@ static irqreturn_t phy_change(struct phy_device *phydev)
750750
return IRQ_NONE;
751751
}
752752

753-
/**
754-
* phy_change_work - Scheduled by the phy_mac_interrupt to handle PHY changes
755-
* @work: work_struct that describes the work to be done
756-
*/
757-
void phy_change_work(struct work_struct *work)
758-
{
759-
struct phy_device *phydev =
760-
container_of(work, struct phy_device, phy_queue);
761-
762-
phy_change(phydev);
763-
}
764-
765753
/**
766754
* phy_interrupt - PHY interrupt handler
767755
* @irq: interrupt line
@@ -1005,7 +993,7 @@ void phy_state_machine(struct work_struct *work)
1005993
void phy_mac_interrupt(struct phy_device *phydev)
1006994
{
1007995
/* Trigger a state machine change */
1008-
queue_work(system_power_efficient_wq, &phydev->phy_queue);
996+
phy_trigger_machine(phydev);
1009997
}
1010998
EXPORT_SYMBOL(phy_mac_interrupt);
1011999

drivers/net/phy/phy_device.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
587587

588588
mutex_init(&dev->lock);
589589
INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
590-
INIT_WORK(&dev->phy_queue, phy_change_work);
591590

592591
/* Request the appropriate module unconditionally; don't
593592
* bother trying to do so only if it isn't already loaded,

include/linux/phy.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ struct phy_c45_device_ids {
369369
* giving up on the current attempt at acquiring a link
370370
* irq: IRQ number of the PHY's interrupt (-1 if none)
371371
* phy_timer: The timer for handling the state machine
372-
* phy_queue: A work_queue for the phy_mac_interrupt
373372
* attached_dev: The attached enet driver's device instance ptr
374373
* adjust_link: Callback for the enet controller to respond to
375374
* changes in the link state.
@@ -454,7 +453,6 @@ struct phy_device {
454453
void *priv;
455454

456455
/* Interrupt and Polling infrastructure */
457-
struct work_struct phy_queue;
458456
struct delayed_work state_queue;
459457

460458
struct mutex lock;
@@ -1029,7 +1027,6 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
10291027
int phy_drivers_register(struct phy_driver *new_driver, int n,
10301028
struct module *owner);
10311029
void phy_state_machine(struct work_struct *work);
1032-
void phy_change_work(struct work_struct *work);
10331030
void phy_mac_interrupt(struct phy_device *phydev);
10341031
void phy_start_machine(struct phy_device *phydev);
10351032
void phy_stop_machine(struct phy_device *phydev);

0 commit comments

Comments
 (0)