Skip to content

Commit 749d56b

Browse files
z3ntuandersson
authored andcommitted
soc: qcom: rmtfs: handle optional qcom,vmid correctly
Older platforms don't have qcom,vmid set, handle -EINVAL return value correctly. And since num_vmids is passed to of_property_read_u32_array later we should make sure it has a sane value before continuing. Fixes: e656cd0 ("soc: qcom: rmtfs: Optionally map RMTFS to more VMs") Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9470074 commit 749d56b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/soc/qcom/rmtfs_mem.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
229229
}
230230

231231
num_vmids = of_property_count_u32_elems(node, "qcom,vmid");
232-
if (num_vmids < 0) {
232+
if (num_vmids == -EINVAL) {
233+
/* qcom,vmid is optional */
234+
num_vmids = 0;
235+
} else if (num_vmids < 0) {
233236
dev_err(&pdev->dev, "failed to count qcom,vmid elements: %d\n", num_vmids);
234237
goto remove_cdev;
235238
} else if (num_vmids > NUM_MAX_VMIDS) {

0 commit comments

Comments
 (0)