power: axp: Remove redundant code
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 7 Aug 2025 14:28:57 +0000 (15:28 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 29 Aug 2025 22:44:46 +0000 (16:44 -0600)
In axp_init after checking the chip ID there is an else clause that
returns ret. ret is guaranteed to be 0 at this point as the code would
have returned above if not. The next statement is a return 0 so the
return ret is redundant, remove it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
drivers/power/axp818.c

index 83ae6ec..01f9a20 100644 (file)
@@ -248,8 +248,6 @@ int axp_init(void)
 
        if (!(axp_chip_id == 0x51))
                return -ENODEV;
-       else
-               return ret;
 
        return 0;
 }