Skip to content

Commit cd8ec43

Browse files
Zhang Zekunandersson
authored andcommitted
soc: qcom: smp2p: Simplify code with dev_err_probe()
Use dev_err_probe() directly in the driver probe phase, and we don't need to judge if the error code is not equal to -EPROBE_DEFER. This can simplify the code a bit. Signed-off-by: Zhang Zekun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 876b405 commit cd8ec43

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/soc/qcom/smp2p.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,9 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
467467
int ret;
468468

469469
ret = qcom_smem_alloc(pid, smem_id, sizeof(*out));
470-
if (ret < 0 && ret != -EEXIST) {
471-
if (ret != -EPROBE_DEFER)
472-
dev_err(smp2p->dev,
473-
"unable to allocate local smp2p item\n");
474-
return ret;
475-
}
470+
if (ret < 0 && ret != -EEXIST)
471+
return dev_err_probe(smp2p->dev, ret,
472+
"unable to allocate local smp2p item\n");
476473

477474
out = qcom_smem_get(pid, smem_id, NULL);
478475
if (IS_ERR(out)) {

0 commit comments

Comments
 (0)