From: Zhang Zekun Date: Mon, 9 Sep 2024 12:29:20 +0000 (+0800) Subject: soc: qcom: smem: Simplify code with dev_err_probe() X-Git-Tag: v6.13-rc1~139^2~12^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=876b405004842b10a684f06f967502d20d64384f;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20240909122921.12627-4-zhangzekun11@huawei.com Signed-off-by: Bjorn Andersson --- diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 0d1ccf3ef1086..cfe358a944717 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -1186,11 +1186,9 @@ static int qcom_smem_probe(struct platform_device *pdev) } hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0); - if (hwlock_id < 0) { - if (hwlock_id != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to retrieve hwlock\n"); - return hwlock_id; - } + if (hwlock_id < 0) + return dev_err_probe(&pdev->dev, hwlock_id, + "failed to retrieve hwlock\n"); smem->hwlock = hwspin_lock_request_specific(hwlock_id); if (!smem->hwlock)