]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
power: regulator: tps65910: Cannot test unsigned for being negative
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 7 Aug 2025 16:35:22 +0000 (17:35 +0100)
committerPeng Fan <peng.fan@nxp.com>
Mon, 1 Sep 2025 02:33:04 +0000 (10:33 +0800)
The code in tps65910_regulator.c treats the field supply in struct
tps65910_regulator_pdata as an int and even tests the value for being
negative so change it from a u32 to int so that the code all works as
expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
include/power/tps65910_pmic.h

index 2026ec2f42648aa890348909be24124646872695..8fa02f33ab15ef20805d9c02db58d39afa01d64e 100644 (file)
@@ -123,7 +123,7 @@ enum {
 
 /* platform data */
 struct tps65910_regulator_pdata {
-       u32 supply;     /* regulator supply voltage in uV */
+       int supply;     /* regulator supply voltage in uV */
        uint unit;      /* unit-address according to DT */
 };