[PATCH net-next 7/8] net: pse-pd: tps23881: Use fsleep instead of mdelay

From: Kory Maincent (AddSecure)

Date: Wed Dec 02 2026 - 09:09:07 EST


The code does not run in atomic context, so busy-waiting with mdelay()
is unnecessary. Use fsleep() instead, which sleeps for the requested
time instead of wasting CPU cycles.

Signed-off-by: Kory Maincent (AddSecure) <kory.maincent@xxxxxxxxxxx>
---
drivers/net/pse-pd/tps23881.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index a7ff69e2561b4..5736f052732a2 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -260,7 +260,7 @@ static int tps23881_pi_disable(struct pse_controller_dev *pcdev, int id)
* configured again. According to the datasheet "It may take upwards
* of 5ms after PWOFFn command for all register values to be updated"
*/
- mdelay(5);
+ fsleep(5000);

/* Disable DC disconnect*/
chan = priv->port[id].chan[0];
@@ -982,7 +982,7 @@ static int tps23881_pi_get_pw_req(struct pse_controller_dev *pcdev, int id)

/* For a 4-pair the classification need 5ms to be completed */
if (priv->port[id].is_4p)
- mdelay(5);
+ fsleep(5000);

chan = priv->port[id].chan[0];
reg = TPS23881_REG_DISC + (chan % 4);
@@ -1121,7 +1121,7 @@ static int tps23881_flash_sram_fw(struct i2c_client *client,
if (ret)
return ret;

- mdelay(12);
+ fsleep(12000);

return 0;
}

--
2.43.0