Skip to content

Commit 5e6fee7

Browse files
Dan Carpenterandersson
authored andcommitted
remoteproc: qcom_q6v5_adsp: Fix a NULL vs IS_ERR() check in adsp_alloc_memory_region()
The devm_ioremap_resource_wc() function never returns NULL, it returns error pointers. Update the check to match. Fixes: c70b9d5 ("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/6d6b1b0fb6a61b5155a640507217fd7e658858cf.1764427595.git.dan.carpenter@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 099a60c commit 5e6fee7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/remoteproc/qcom_q6v5_adsp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,10 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp)
637637
adsp->mem_phys = adsp->mem_reloc = res.start;
638638
adsp->mem_size = resource_size(&res);
639639
adsp->mem_region = devm_ioremap_resource_wc(adsp->dev, &res);
640-
if (!adsp->mem_region) {
640+
if (IS_ERR(adsp->mem_region)) {
641641
dev_err(adsp->dev, "unable to map memory region: %pR\n", &res);
642-
return -EBUSY;
642+
return PTR_ERR(adsp->mem_region);
643+
643644
}
644645

645646
return 0;

0 commit comments

Comments
 (0)