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.goodb...@linaro.org>
---
 drivers/power/axp818.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/power/axp818.c b/drivers/power/axp818.c
index 83ae6ecc138..01f9a209dc6 100644
--- a/drivers/power/axp818.c
+++ b/drivers/power/axp818.c
@@ -248,8 +248,6 @@ int axp_init(void)
 
        if (!(axp_chip_id == 0x51))
                return -ENODEV;
-       else
-               return ret;
 
        return 0;
 }

-- 
2.39.5

Reply via email to