[PATCH net-next 4/8] net: pse-pd: tps23881: Use new mW/uA conversion helpers

From: Kory Maincent (AddSecure)

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


Now that we have helpers for the mW/uA conversion, use them in the
tps23881 driver to avoid duplicating the code.

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

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 244ce596d845c..d993652a508d1 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -424,7 +424,6 @@ tps23881_pi_get_actual_pw(struct pse_controller_dev *pcdev, int id)
{
struct tps23881_priv *priv = to_tps23881_priv(pcdev);
int ret, uV, uA;
- u64 tmp_64;
u8 chan;

ret = tps23881_pi_get_voltage(&priv->pcdev, id);
@@ -446,10 +445,7 @@ tps23881_pi_get_actual_pw(struct pse_controller_dev *pcdev, int id)
uA += ret;
}

- tmp_64 = uV;
- tmp_64 *= uA;
- /* mW = uV * uA / 1000000000 */
- return DIV_ROUND_CLOSEST_ULL(tmp_64, 1000000000);
+ return pse_to_mW(uA, uV);
}

static int

--
2.43.0