Skip to content

Commit

Permalink
soc: ti: k3-socinfo: Avoid overriding return value
Browse files Browse the repository at this point in the history
Avoid overriding the return value and make sure the right error code
is reflected. If the part is none of the identified list present in
k3_soc_ids[], return -ENODEV.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Link: https://lore.kernel.org/r/20231016101608.993921-3-n-francis@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
  • Loading branch information
Neha Malcom Francis authored and Nishanth Menon committed Oct 16, 2023
1 parent 8dec342 commit 3aeb0d3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/soc/ti/k3-socinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ k3_chipinfo_partno_to_names(unsigned int partno,
return 0;
}

return -EINVAL;
return -ENODEV;
}

static int k3_chipinfo_probe(struct platform_device *pdev)
Expand Down Expand Up @@ -111,8 +111,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)

ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr);
if (ret) {
dev_err(dev, "Unknown SoC JTAGID[0x%08X]\n", jtag_id);
ret = -ENODEV;
dev_err(dev, "Unknown SoC JTAGID[0x%08X]: %d\n", jtag_id, ret);
goto err_free_rev;
}

Expand Down

0 comments on commit 3aeb0d3

Please sign in to comment.