All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy
@ 2021-12-30  7:09 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2021-12-30  7:09 UTC (permalink / raw)
  Cc: linmq006, Rob Clark, Sean Paul, David Airlie, Daniel Vetter,
	Dmitry Baryshkov, Abhinav Kumar, Bjorn Andersson, Dan Carpenter,
	Christophe JAILLET, Hai Li, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

If of_find_device_by_node() succeeds, dsi_get_phy() doesn't
a corresponding put_device(). Thus add put_device() to fix the exception
handling.

Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/gpu/drm/msm/dsi/dsi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 75ae3008b68f..35be526e907a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
 
 	of_node_put(phy_node);
 
-	if (!phy_pdev || !msm_dsi->phy) {
+	if (!phy_pdev) {
+		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
+		return -EPROBE_DEFER;
+	}
+	if (!msm_dsi->phy) {
+		put_device(&phy_pdev->dev);
 		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
 		return -EPROBE_DEFER;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy
@ 2021-12-30  7:09 ` Miaoqian Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Miaoqian Lin @ 2021-12-30  7:09 UTC (permalink / raw)
  Cc: freedreno, linmq006, David Airlie, Hai Li, linux-kernel,
	Abhinav Kumar, Bjorn Andersson, Christophe JAILLET, dri-devel,
	linux-arm-msm, Dmitry Baryshkov, Sean Paul, Dan Carpenter

If of_find_device_by_node() succeeds, dsi_get_phy() doesn't
a corresponding put_device(). Thus add put_device() to fix the exception
handling.

Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/gpu/drm/msm/dsi/dsi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 75ae3008b68f..35be526e907a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
 
 	of_node_put(phy_node);
 
-	if (!phy_pdev || !msm_dsi->phy) {
+	if (!phy_pdev) {
+		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
+		return -EPROBE_DEFER;
+	}
+	if (!msm_dsi->phy) {
+		put_device(&phy_pdev->dev);
 		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
 		return -EPROBE_DEFER;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy
  2021-12-30  7:09 ` Miaoqian Lin
@ 2022-01-19 23:16   ` Dmitry Baryshkov
  -1 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2022-01-19 23:16 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, Abhinav Kumar,
	Bjorn Andersson, Dan Carpenter, Christophe JAILLET, Hai Li,
	linux-arm-msm, dri-devel, freedreno, linux-kernel

On 30/12/2021 10:09, Miaoqian Lin wrote:
> If of_find_device_by_node() succeeds, dsi_get_phy() doesn't
> a corresponding put_device(). Thus add put_device() to fix the exception
> handling.
> 
> Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>   drivers/gpu/drm/msm/dsi/dsi.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index 75ae3008b68f..35be526e907a 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
>   
>   	of_node_put(phy_node);
>   
> -	if (!phy_pdev || !msm_dsi->phy) {
> +	if (!phy_pdev) {
> +		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
> +		return -EPROBE_DEFER;
> +	}
> +	if (!msm_dsi->phy) {
> +		put_device(&phy_pdev->dev);
>   		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
>   		return -EPROBE_DEFER;
>   	}


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy
@ 2022-01-19 23:16   ` Dmitry Baryshkov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2022-01-19 23:16 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: freedreno, David Airlie, Hai Li, linux-kernel, Abhinav Kumar,
	Bjorn Andersson, Christophe JAILLET, dri-devel, linux-arm-msm,
	Sean Paul, Dan Carpenter

On 30/12/2021 10:09, Miaoqian Lin wrote:
> If of_find_device_by_node() succeeds, dsi_get_phy() doesn't
> a corresponding put_device(). Thus add put_device() to fix the exception
> handling.
> 
> Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>   drivers/gpu/drm/msm/dsi/dsi.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
> index 75ae3008b68f..35be526e907a 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi.c
> @@ -40,7 +40,12 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
>   
>   	of_node_put(phy_node);
>   
> -	if (!phy_pdev || !msm_dsi->phy) {
> +	if (!phy_pdev) {
> +		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
> +		return -EPROBE_DEFER;
> +	}
> +	if (!msm_dsi->phy) {
> +		put_device(&phy_pdev->dev);
>   		DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__);
>   		return -EPROBE_DEFER;
>   	}


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-19 23:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30  7:09 [PATCH] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy Miaoqian Lin
2021-12-30  7:09 ` Miaoqian Lin
2022-01-19 23:16 ` Dmitry Baryshkov
2022-01-19 23:16   ` Dmitry Baryshkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.