Skip to content

Commit 876b405

Browse files
Zhang Zekunandersson
authored andcommitted
soc: qcom: smem: 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 <zhangzekun11@huawei.com> Link: https://lore.kernel.org/r/20240909122921.12627-4-zhangzekun11@huawei.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 454381b commit 876b405

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/soc/qcom/smem.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,11 +1186,9 @@ static int qcom_smem_probe(struct platform_device *pdev)
11861186
}
11871187

11881188
hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0);
1189-
if (hwlock_id < 0) {
1190-
if (hwlock_id != -EPROBE_DEFER)
1191-
dev_err(&pdev->dev, "failed to retrieve hwlock\n");
1192-
return hwlock_id;
1193-
}
1189+
if (hwlock_id < 0)
1190+
return dev_err_probe(&pdev->dev, hwlock_id,
1191+
"failed to retrieve hwlock\n");
11941192

11951193
smem->hwlock = hwspin_lock_request_specific(hwlock_id);
11961194
if (!smem->hwlock)

0 commit comments

Comments
 (0)