Re: [PATCH 3/3] soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available
From: Konrad Dybcio
Date: Mon Mar 23 2026 - 06:23:20 EST
On 3/23/26 2:20 AM, Dmitry Baryshkov wrote:
> If OCMEM is declared in DT, it is expected that it is present and
> handled by the driver. The GPU driver will ignore -ENODEV error, which
> typically means that OCMEM isn't defined in DT. Let ocmem return
> -EPROBE_DEFER if it supposed to be used, but it is not probed (yet).
>
> Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
> ---
> drivers/soc/qcom/ocmem.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
> index d57baa9cfa03..c35a98984acc 100644
> --- a/drivers/soc/qcom/ocmem.c
> +++ b/drivers/soc/qcom/ocmem.c
> @@ -203,10 +203,9 @@ struct ocmem *of_get_ocmem(struct device *dev)
>
> ocmem = platform_get_drvdata(pdev);
> put_device(&pdev->dev);
> - if (!ocmem) {
> - dev_err(dev, "Cannot get ocmem\n");
> - return ERR_PTR(-ENODEV);
> - }
> + if (!ocmem)
> + return ERR_PTR(dev_err_probe(dev, -EPROBE_DEFER, "Cannot get ocmem\n"));
dev_err_ptr_probe()
Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Konrad