RE: [EXTERNAL] [PATCH net v2] net: micrel: Fix lan8841_config_intr after getting out of sleep mode
From: Suman Ghosh
Date: Fri May 24 2024 - 05:29:31 EST
>diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index
>13e30ea7eec5d..c0773d74d5104 100644
>--- a/drivers/net/phy/micrel.c
>+++ b/drivers/net/phy/micrel.c
>@@ -4029,7 +4029,7 @@ static int lan8841_config_intr(struct phy_device
>*phydev)
>
> if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
> err = phy_read(phydev, LAN8814_INTS);
>- if (err)
>+ if (err < 0)
> return err;
>
> /* Enable / disable interrupts. It is OK to enable PTP
>interrupt @@ -4045,6 +4045,14 @@ static int lan8841_config_intr(struct
>phy_device *phydev)
> return err;
>
> err = phy_read(phydev, LAN8814_INTS);
>+ if (err < 0)
>+ return err;
>+
>+ /* Getting a positive value doesn't mean that is an error, it
>+ * just indicates what was the status. Therefore make sure to
>+ * clear the value and say that there is no error.
>+ */
>+ err = 0;
[Suman] Looks good to me.
Reviewed-by: Suman Ghosh <sumang@xxxxxxxxxxx>
> }
>
> return err;
>--
>2.34.1