]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: eswin: Fix unsigned comparison to less than zero issue
authorColin Ian King <colin.i.king@gmail.com>
Mon, 23 Jun 2025 22:20:04 +0000 (23:20 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 24 Jun 2025 19:37:49 +0000 (21:37 +0200)
The u32 variable voltage is being compared to less than zero and
this can never be true. Fix this by making voltage an int type which
is the same type as the return from the call to regulator_get_voltage.

Fixes: 5b797bcc00ef ("pinctrl: eswin: Add EIC7700 pinctrl driver")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/20250623222004.280928-1-colin.i.king@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-eic7700.c

index 719cd11e276aa2d95b9c2b51b5680ad90aaba970..4874b55323439acdcfba64c75f7b7e32885c79b3 100644 (file)
@@ -622,8 +622,8 @@ static int eic7700_pinctrl_probe(struct platform_device *pdev)
        struct pinctrl_dev *pctldev;
        struct eic7700_pinctrl *pc;
        struct regulator *regulator;
-       u32 voltage, rgmii0_mode, rgmii1_mode;
-       int ret;
+       u32 rgmii0_mode, rgmii1_mode;
+       int ret, voltage;
 
        pc = devm_kzalloc(dev, struct_size(pc, functions, EIC7700_FUNCTIONS_COUNT), GFP_KERNEL);
        if (!pc)