[PATCH 5.12 148/173] phy: ti: Fix an error code in wiz_probe()
From: Greg Kroah-Hartman
Date: Mon Jun 14 2021 - 07:35:59 EST
From: Yang Li <yang.lee@xxxxxxxxxxxxxxxxx>
commit b8203ec7f58ae925e10fadd3d136073ae7503a6e upstream.
When the code execute this if statement, the value of ret is 0.
However, we can see from the dev_err() log that the value of
ret should be -EINVAL.
Clean up smatch warning:
drivers/phy/ti/phy-j721e-wiz.c:1216 wiz_probe() warn: missing error code 'ret'
Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
Fixes: c9f9eba06629 ("phy: ti: j721e-wiz: Manage typec-gpio-dir")
Signed-off-by: Yang Li <yang.lee@xxxxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/1621939832-65535-1-git-send-email-yang.lee@xxxxxxxxxxxxxxxxx
Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/phy/ti/phy-j721e-wiz.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/phy/ti/phy-j721e-wiz.c
+++ b/drivers/phy/ti/phy-j721e-wiz.c
@@ -894,6 +894,7 @@ static int wiz_probe(struct platform_dev
if (wiz->typec_dir_delay < WIZ_TYPEC_DIR_DEBOUNCE_MIN ||
wiz->typec_dir_delay > WIZ_TYPEC_DIR_DEBOUNCE_MAX) {
+ ret = -EINVAL;
dev_err(dev, "Invalid typec-dir-debounce property\n");
goto err_addr_to_resource;
}