From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.85.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220530; b=FnzZoNdRwNWoHC88+OWJfwyNgiBNaogDHTEWSP5rrU9akWGfOnxJOt4d1oDMWFW7Yri8 ytZEpymLkGKEmNh6yUMIoJAvaNFjERl72W4Q7J7uOnzALaaND0uIIhQc8BnjYbjVXD5iw 3p4Kp3NmJoojyTRSXaLetJPh+1G/U7xBPme9doy2tGRXnJIhHzUw+guZ0J9tgT1qj5BFg X1MqIhr9zQoaYdvrS+CNWxbNpHb8ZoipFd9BSjuaOySpNqEIk821WBSkujoTBQdxYhq1Y DNfo8olmPA/g5xsJl+WphrQ2uK8uW1wy/SvMdR9R3vmiieciG/SqLudcBarO/q3jalQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220530; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Last-TLS-Session-Version; bh=9AnUpHrfG/EO0FxrYWIHQjdtcvBmRS3svV5vj/ndBlE=; b=1BRQMxQowcpoPAO5zQVKv3QkthN+JqD/Ta3EtApOJ2sQvE3TU+aQXC3yAM9eMKMqfSEE szqKFoai5/BO8SfnSM1lP1+4k755i5l90bvTqW5FA3eIk0ogj4jM+wPBfLy4UMnqUqcOT 8lrJ9qHPkSjxjyrfE5NQKSru4gtX7ZiIP5cI4PycIe/69uoykjAzoxiw36xCDrbl7AXKX o0a9yP+brjqRUt6t1mWkG7Arcbf+kUcVSs3Lq4MwvXyRjG7kt4zhigj00SStwAmXvCH0p zlFmCTAq+8791tZCn7A2R2OddmhaXjpMt5aT3pVtrUxxpmigo+VVkdf0zgcnbu4E46w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=2JFfs1Zq; arc=none smtp.remote-ip=185.246.85.4 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A92DA60A2602; Wed, 2 Dec 2026 14:08:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A92DA60A2602 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=2JFfs1Zq Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 762094E41849; Wed, 2 Dec 2026 14:08:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 44A5D6075F; Wed, 2 Dec 2026 14:08:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 29D7811EA198D; Wed, 02 Dec 2026 15:08:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796220526; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=9AnUpHrfG/EO0FxrYWIHQjdtcvBmRS3svV5vj/ndBlE=; b=2JFfs1ZqqwdtEUj4xKKdaiD14HHhohD3oSNwGMdOj7vpJ0ur9C1Ges3AvN+noGaSPXJHwh 3YvOxjnjHieON0dX98dl/P6EAVbW6GS1528WW99BgWd35Cu4fI7fHKsYk8bBPEVJH5NnUq gKPkLxnneOF9+6AOXrBx+rqI8Fvx9sHlpiy5f7YbxF0oIE7jm+eyQ5d3OR7G+T4G0eEFRV HA2Gqh03VEWN9wP3Uku9bsJY27exCxQmQV7xJfp9+CfBBh+SJeljY5pmK8kcNTslk2wxTF PlWpSC2JeVpV0LBOCxYarSrvKM6fEDYueoyCu9SX2vFaNEeTbd9DKXdql2NBFA== From: "Kory Maincent (AddSecure)" Date: Wed, 02 Dec 2026 15:08:11 +0100 Subject: [PATCH net-next 4/8] net: pse-pd: tps23881: Use new mW/uA conversion helpers X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-feat_tps23861-v1-4-7d8320369817@bootlin.com> References: <20261202-feat_tps23861-v1-0-7d8320369817@bootlin.com> In-Reply-To: <20261202-feat_tps23861-v1-0-7d8320369817@bootlin.com> To: Oleksij Rempel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: roman@damex.org, maxime.chevallier@bootlin.com, Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Phil.Edworthy@addsecure.com, devicetree@vger.kernel.org, "Kory Maincent (AddSecure)" X-Mailer: b4 0.16.1-dev-17221 X-Last-TLS-Session-Version: TLSv1.3 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) --- 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