Commit e2ae8bca authored by Wei Yongjun's avatar Wei Yongjun Committed by Kishon Vijay Abraham I

phy: ti: j721e-wiz: Fix some error return code in wiz_probe()

Fix to return negative error code from some error handling
cases instead of 0, as done elsewhere in this function.

Fixes: 091876cc ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarRoger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200507054109.110849-1-weiyongjun1@huawei.comSigned-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 6d9c1de8
...@@ -841,8 +841,10 @@ static int wiz_probe(struct platform_device *pdev) ...@@ -841,8 +841,10 @@ static int wiz_probe(struct platform_device *pdev)
} }
base = devm_ioremap(dev, res.start, resource_size(&res)); base = devm_ioremap(dev, res.start, resource_size(&res));
if (!base) if (!base) {
ret = -ENOMEM;
goto err_addr_to_resource; goto err_addr_to_resource;
}
regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config); regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config);
if (IS_ERR(regmap)) { if (IS_ERR(regmap)) {
...@@ -859,6 +861,7 @@ static int wiz_probe(struct platform_device *pdev) ...@@ -859,6 +861,7 @@ static int wiz_probe(struct platform_device *pdev)
if (num_lanes > WIZ_MAX_LANES) { if (num_lanes > WIZ_MAX_LANES) {
dev_err(dev, "Cannot support %d lanes\n", num_lanes); dev_err(dev, "Cannot support %d lanes\n", num_lanes);
ret = -ENODEV;
goto err_addr_to_resource; goto err_addr_to_resource;
} }
...@@ -948,6 +951,7 @@ static int wiz_probe(struct platform_device *pdev) ...@@ -948,6 +951,7 @@ static int wiz_probe(struct platform_device *pdev)
serdes_pdev = of_platform_device_create(child_node, NULL, dev); serdes_pdev = of_platform_device_create(child_node, NULL, dev);
if (!serdes_pdev) { if (!serdes_pdev) {
dev_WARN(dev, "Unable to create SERDES platform device\n"); dev_WARN(dev, "Unable to create SERDES platform device\n");
ret = -ENOMEM;
goto err_pdev_create; goto err_pdev_create;
} }
wiz->serdes_pdev = serdes_pdev; wiz->serdes_pdev = serdes_pdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment