net: phy: improve phy_driver callback handle_interrupt
did_interrupt() clears the interrupt, therefore handle_interrupt() can not check which event triggered the interrupt. To overcome this constraint and allow more flexibility for customer interrupt handlers, let's decouple handle_interrupt() from parts of the phylib interrupt handling. Custom interrupt handlers now have to implement the did_interrupt() functionality in handle_interrupt() if needed. Fortunately we have just one custom interrupt handler so far (in the mscc PHY driver), convert it to the changed API. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
225fc22388
commit
9010f9deb0
@@ -23,6 +23,7 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/u64_stats_sync.h>
|
||||
#include <linux/irqreturn.h>
|
||||
|
||||
#include <linux/atomic.h>
|
||||
|
||||
@@ -568,7 +569,7 @@ struct phy_driver {
|
||||
int (*did_interrupt)(struct phy_device *phydev);
|
||||
|
||||
/* Override default interrupt handling */
|
||||
int (*handle_interrupt)(struct phy_device *phydev);
|
||||
irqreturn_t (*handle_interrupt)(struct phy_device *phydev);
|
||||
|
||||
/* Clears up any memory if needed */
|
||||
void (*remove)(struct phy_device *phydev);
|
||||
|
Reference in New Issue
Block a user