[PATCH net-next 03/19] net: phy: make .ack_interrupt() optional

From: Ioana Ciornei
Date: Thu Oct 29 2020 - 06:08:49 EST


From: Ioana Ciornei <ioana.ciornei@xxxxxxx>

As a first step into making phylib and all PHY drivers to actually
have support for shared IRQs, make the .ack_interrupt() callback
optional.

After all drivers have been moved to implement the generic
interrupt handle, the phy_drv_supports_irq() check will be
changed again to only require the .handle_interrupts() callback.

Cc: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx>
Cc: Andre Edich <andre.edich@xxxxxxxxxxxxx>
Cc: Antoine Tenart <atenart@xxxxxxxxxx>
Cc: Baruch Siach <baruch@xxxxxxxxxx>
Cc: Christophe Leroy <christophe.leroy@xxxxxx>
Cc: Dan Murphy <dmurphy@xxxxxx>
Cc: Divya Koppera <Divya.Koppera@xxxxxxxxxxxxx>
Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
Cc: Hauke Mehrtens <hauke@xxxxxxxxxx>
Cc: Heiner Kallweit <hkallweit1@xxxxxxxxx>
Cc: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@xxxxxxxxxxxxx>
Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
Cc: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
Cc: Marek Vasut <marex@xxxxxxx>
Cc: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>
Cc: Mathias Kresin <dev@xxxxxxxxx>
Cc: Maxim Kochetkov <fido_max@xxxxxxxx>
Cc: Michael Walle <michael@xxxxxxxx>
Cc: Neil Armstrong <narmstrong@xxxxxxxxxxxx>
Cc: Nisar Sayed <Nisar.Sayed@xxxxxxxxxxxxx>
Cc: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Cc: Philippe Schenker <philippe.schenker@xxxxxxxxxxx>
Cc: Willy Liu <willy.liu@xxxxxxxxxxx>
Cc: Yuiko Oshino <yuiko.oshino@xxxxxxxxxxxxx>
Signed-off-by: Ioana Ciornei <ioana.ciornei@xxxxxxx>
---
drivers/net/phy/phy_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 413a0a2c5d51..f54f483d7fd6 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2815,7 +2815,7 @@ EXPORT_SYMBOL(phy_get_internal_delay);

static bool phy_drv_supports_irq(struct phy_driver *phydrv)
{
- return phydrv->config_intr && phydrv->ack_interrupt;
+ return phydrv->config_intr && (phydrv->ack_interrupt || phydrv->handle_interrupt);
}

/**
--
2.28.0