diff mbox

[v2,1/8] drm/bridge/synopsys: dsi: move mipi_dsi_host_unregister to __dw_mipi_dsi_remove

Message ID 20180618102806.15650-2-heiko@sntech.de (mailing list archive)
State New, archived
Headers show

Commit Message

Heiko Stuebner June 18, 2018, 10:27 a.m. UTC
Right now the host is only unregistered when the driver is used via the
bridge api and not via the component api, leading to the host staying
registered in cases like probe deferral.

So move the host unregister to the general remove function, so that it
gets cleaned up in all cases.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrzej Hajda July 3, 2018, 10:40 a.m. UTC | #1
On 18.06.2018 12:27, Heiko Stuebner wrote:
> Right now the host is only unregistered when the driver is used via the
> bridge api and not via the component api, leading to the host staying
> registered in cases like probe deferral.
>
> So move the host unregister to the general remove function, so that it
> gets cleaned up in all cases.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

I have lurked into the only current user of the bridge (stm), and I am
little bit confused how does it work, but this change looks OK.

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index fd7999642cf8..07cde255cab2 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -941,6 +941,8 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
>  
>  static void __dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
>  {
> +	mipi_dsi_host_unregister(&dsi->dsi_host);
> +
>  	pm_runtime_disable(dsi->dev);
>  }
>  
> @@ -957,8 +959,6 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_probe);
>  
>  void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
>  {
> -	mipi_dsi_host_unregister(&dsi->dsi_host);
> -
>  	__dw_mipi_dsi_remove(dsi);
>  }
>  EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
Philippe CORNU July 3, 2018, 11:58 a.m. UTC | #2
Hi Heiko,


On 06/18/2018 12:27 PM, Heiko Stuebner wrote:
> Right now the host is only unregistered when the driver is used via the
> bridge api and not via the component api, leading to the host staying
> registered in cases like probe deferral.
> 
> So move the host unregister to the general remove function, so that it
> gets cleaned up in all cases.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>   drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index fd7999642cf8..07cde255cab2 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -941,6 +941,8 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
>   
>   static void __dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
>   {
> +	mipi_dsi_host_unregister(&dsi->dsi_host);
> +
>   	pm_runtime_disable(dsi->dev);
>   }
>   
> @@ -957,8 +959,6 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_probe);
>   
>   void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
>   {
> -	mipi_dsi_host_unregister(&dsi->dsi_host);
> -

Thank you for your patch,

Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>

Philippe :-)

>   	__dw_mipi_dsi_remove(dsi);
>   }
>   EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index fd7999642cf8..07cde255cab2 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -941,6 +941,8 @@  __dw_mipi_dsi_probe(struct platform_device *pdev,
 
 static void __dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
 {
+	mipi_dsi_host_unregister(&dsi->dsi_host);
+
 	pm_runtime_disable(dsi->dev);
 }
 
@@ -957,8 +959,6 @@  EXPORT_SYMBOL_GPL(dw_mipi_dsi_probe);
 
 void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
 {
-	mipi_dsi_host_unregister(&dsi->dsi_host);
-
 	__dw_mipi_dsi_remove(dsi);
 }
 EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);