Instead of printing messages to the dmesg, let the message be recorded
as a reason for the OCMEM client deferral.
Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/soc/qcom/ocmem.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
index dd46bb14b7be..d57baa9cfa03 100644
--- a/drivers/soc/qcom/ocmem.c
+++ b/drivers/soc/qcom/ocmem.c
@@ -196,10 +196,10 @@ struct ocmem *of_get_ocmem(struct device *dev)
}
pdev = of_find_device_by_node(devnode->parent);
- if (!pdev) {
- dev_err(dev, "Cannot find device node %s\n", devnode->name);
- return ERR_PTR(-EPROBE_DEFER);
- }
+ if (!pdev)
+ return ERR_PTR(dev_err_probe(dev, -EPROBE_DEFER,
+ "Cannot find device node %s\n",
+ devnode->name));
ocmem = platform_get_drvdata(pdev);
put_device(&pdev->dev);
--
2.47.3
On Mon, Mar 23, 2026 at 03:20:58AM +0200, Dmitry Baryshkov wrote:
> Instead of printing messages to the dmesg, let the message be recorded
> as a reason for the OCMEM client deferral.
>
> Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/soc/qcom/ocmem.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
> index dd46bb14b7be..d57baa9cfa03 100644
> --- a/drivers/soc/qcom/ocmem.c
> +++ b/drivers/soc/qcom/ocmem.c
> @@ -196,10 +196,10 @@ struct ocmem *of_get_ocmem(struct device *dev)
> }
>
> pdev = of_find_device_by_node(devnode->parent);
> - if (!pdev) {
> - dev_err(dev, "Cannot find device node %s\n", devnode->name);
> - return ERR_PTR(-EPROBE_DEFER);
> - }
> + if (!pdev)
> + return ERR_PTR(dev_err_probe(dev, -EPROBE_DEFER,
> + "Cannot find device node %s\n",
> + devnode->name));
Reviewed-by: Brian Masney <bmasney@redhat.com>
dev_err_probe() was introduced in 2020 (a787e5400a1c) and this driver
was added to the tree prior to that.
On Mon, Mar 23, 2026 at 07:07:40AM -0400, Brian Masney wrote:
> On Mon, Mar 23, 2026 at 03:20:58AM +0200, Dmitry Baryshkov wrote:
> > Instead of printing messages to the dmesg, let the message be recorded
> > as a reason for the OCMEM client deferral.
> >
> > Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > ---
> > drivers/soc/qcom/ocmem.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
> > index dd46bb14b7be..d57baa9cfa03 100644
> > --- a/drivers/soc/qcom/ocmem.c
> > +++ b/drivers/soc/qcom/ocmem.c
> > @@ -196,10 +196,10 @@ struct ocmem *of_get_ocmem(struct device *dev)
> > }
> >
> > pdev = of_find_device_by_node(devnode->parent);
> > - if (!pdev) {
> > - dev_err(dev, "Cannot find device node %s\n", devnode->name);
> > - return ERR_PTR(-EPROBE_DEFER);
> > - }
> > + if (!pdev)
> > + return ERR_PTR(dev_err_probe(dev, -EPROBE_DEFER,
> > + "Cannot find device node %s\n",
> > + devnode->name));
>
> Reviewed-by: Brian Masney <bmasney@redhat.com>
>
> dev_err_probe() was introduced in 2020 (a787e5400a1c) and this driver
> was added to the tree prior to that.
Well... Fixes doesnt' require porting (or 1:1 porting).
--
With best wishes
Dmitry
On 3/23/26 2:20 AM, Dmitry Baryshkov wrote:
> Instead of printing messages to the dmesg, let the message be recorded
> as a reason for the OCMEM client deferral.
>
> Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/soc/qcom/ocmem.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
> index dd46bb14b7be..d57baa9cfa03 100644
> --- a/drivers/soc/qcom/ocmem.c
> +++ b/drivers/soc/qcom/ocmem.c
> @@ -196,10 +196,10 @@ struct ocmem *of_get_ocmem(struct device *dev)
> }
>
> pdev = of_find_device_by_node(devnode->parent);
> - if (!pdev) {
> - dev_err(dev, "Cannot find device node %s\n", devnode->name);
> - return ERR_PTR(-EPROBE_DEFER);
> - }
> + if (!pdev)
> + return ERR_PTR(dev_err_probe(dev, -EPROBE_DEFER,
> + "Cannot find device node %s\n",
> + devnode->name));
dev_err_ptr_probe()
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
On Mon, Mar 23, 2026 at 11:16:54AM +0100, Konrad Dybcio wrote:
> On 3/23/26 2:20 AM, Dmitry Baryshkov wrote:
> > Instead of printing messages to the dmesg, let the message be recorded
> > as a reason for the OCMEM client deferral.
> >
> > Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > ---
> > drivers/soc/qcom/ocmem.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
> > index dd46bb14b7be..d57baa9cfa03 100644
> > --- a/drivers/soc/qcom/ocmem.c
> > +++ b/drivers/soc/qcom/ocmem.c
> > @@ -196,10 +196,10 @@ struct ocmem *of_get_ocmem(struct device *dev)
> > }
> >
> > pdev = of_find_device_by_node(devnode->parent);
> > - if (!pdev) {
> > - dev_err(dev, "Cannot find device node %s\n", devnode->name);
> > - return ERR_PTR(-EPROBE_DEFER);
> > - }
> > + if (!pdev)
> > + return ERR_PTR(dev_err_probe(dev, -EPROBE_DEFER,
> > + "Cannot find device node %s\n",
> > + devnode->name));
>
> dev_err_ptr_probe()
Cool!
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Konrad
--
With best wishes
Dmitry
© 2016 - 2026 Red Hat, Inc.