net: pse-pd: pd692x0: Skip power budget configuration when undefined
authorKory Maincent <kory.maincent@bootlin.com>
Wed, 20 Aug 2025 13:33:21 +0000 (15:33 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Aug 2025 14:56:08 +0000 (07:56 -0700)
If the power supply's power budget is not defined in the device tree,
the current code still requests power and configures the PSE manager
with a 0W power limit, which is undesirable behavior.

Skip power budget configuration entirely when the budget is zero,
avoiding unnecessary power requests and preventing invalid 0W limits
from being set on the PSE manager.

Fixes: 359754013e6a ("net: pse-pd: pd692x0: Add support for PSE PI priority feature")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250820133321.841054-1-kory.maincent@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/pse-pd/pd692x0.c

index 395f6c662175c07b51ce75b48041869e5ed5b6f5..f4e91ba64a666c861255ccd72d764637908ec70a 100644 (file)
@@ -1041,6 +1041,10 @@ pd692x0_configure_managers(struct pd692x0_priv *priv, int nmanagers)
                int pw_budget;
 
                pw_budget = regulator_get_unclaimed_power_budget(supply);
+               if (!pw_budget)
+                       /* Do nothing if no power budget */
+                       continue;
+
                /* Max power budget per manager */
                if (pw_budget > 6000000)
                        pw_budget = 6000000;