remoteproc: qcom: qcom_q6v5_adsp: Fix some return value check
In case of error, the functions devm_kcalloc() and devm_ioremap()
returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return
value check should be replaced with NULL test.
Also removed -EPROBE_DEFER check since devm_kcalloc never return
this error.
Fixes: dc160e4491
("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
ffa5f9c848
commit
6e6b1ada0c
|
@ -295,12 +295,8 @@ static int adsp_init_clock(struct qcom_adsp *adsp)
|
||||||
adsp->num_clks = ARRAY_SIZE(adsp_clk_id);
|
adsp->num_clks = ARRAY_SIZE(adsp_clk_id);
|
||||||
adsp->clks = devm_kcalloc(adsp->dev, adsp->num_clks,
|
adsp->clks = devm_kcalloc(adsp->dev, adsp->num_clks,
|
||||||
sizeof(*adsp->clks), GFP_KERNEL);
|
sizeof(*adsp->clks), GFP_KERNEL);
|
||||||
if (IS_ERR(adsp->clks)) {
|
if (!adsp->clks)
|
||||||
ret = PTR_ERR(adsp->clks);
|
return -ENOMEM;
|
||||||
if (ret != -EPROBE_DEFER)
|
|
||||||
dev_err(adsp->dev, "failed to get adsp clock");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < adsp->num_clks; i++)
|
for (i = 0; i < adsp->num_clks; i++)
|
||||||
adsp->clks[i].id = adsp_clk_id[i];
|
adsp->clks[i].id = adsp_clk_id[i];
|
||||||
|
@ -337,9 +333,9 @@ static int adsp_init_mmio(struct qcom_adsp *adsp,
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
adsp->qdsp6ss_base = devm_ioremap(&pdev->dev, res->start,
|
adsp->qdsp6ss_base = devm_ioremap(&pdev->dev, res->start,
|
||||||
resource_size(res));
|
resource_size(res));
|
||||||
if (IS_ERR(adsp->qdsp6ss_base)) {
|
if (!adsp->qdsp6ss_base) {
|
||||||
dev_err(adsp->dev, "failed to map QDSP6SS registers\n");
|
dev_err(adsp->dev, "failed to map QDSP6SS registers\n");
|
||||||
return PTR_ERR(adsp->qdsp6ss_base);
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
syscon = of_parse_phandle(pdev->dev.of_node, "qcom,halt-regs", 0);
|
syscon = of_parse_phandle(pdev->dev.of_node, "qcom,halt-regs", 0);
|
||||||
|
|
Loading…
Reference in New Issue