The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/bridge: tc358762: use devm for bridge registration and DSI attach
@ 2026-05-21 21:52 Osama Abdelkader
  2026-05-21 21:52 ` [PATCH 2/2] drm/bridge: tc358764: " Osama Abdelkader
  2026-07-06 12:59 ` [PATCH 1/2] drm/bridge: tc358762: " Osama Abdelkader
  0 siblings, 2 replies; 3+ messages in thread
From: Osama Abdelkader @ 2026-05-21 21:52 UTC (permalink / raw)
  To: luca.ceresoli, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel
  Cc: Osama Abdelkader

Replace manual drm_bridge_remove()/mipi_dsi_detach() in remove with
devm_drm_bridge_add() and devm_mipi_dsi_attach() in probe. Also check
the return value from bridge registration.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/bridge/tc358762.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
index 3d75d9cfa45e..3a021ca895f1 100644
--- a/drivers/gpu/drm/bridge/tc358762.c
+++ b/drivers/gpu/drm/bridge/tc358762.c
@@ -293,25 +293,17 @@ static int tc358762_probe(struct mipi_dsi_device *dsi)
 	ctx->bridge.of_node = dev->of_node;
 	ctx->bridge.pre_enable_prev_first = true;
 
-	drm_bridge_add(&ctx->bridge);
+	ret = devm_drm_bridge_add(dev, &ctx->bridge);
+	if (ret < 0)
+		return ret;
 
-	ret = mipi_dsi_attach(dsi);
-	if (ret < 0) {
-		drm_bridge_remove(&ctx->bridge);
+	ret = devm_mipi_dsi_attach(dev, dsi);
+	if (ret < 0)
 		dev_err(dev, "failed to attach dsi\n");
-	}
 
 	return ret;
 }
 
-static void tc358762_remove(struct mipi_dsi_device *dsi)
-{
-	struct tc358762 *ctx = mipi_dsi_get_drvdata(dsi);
-
-	mipi_dsi_detach(dsi);
-	drm_bridge_remove(&ctx->bridge);
-}
-
 static const struct of_device_id tc358762_of_match[] = {
 	{ .compatible = "toshiba,tc358762" },
 	{ }
@@ -320,7 +312,6 @@ MODULE_DEVICE_TABLE(of, tc358762_of_match);
 
 static struct mipi_dsi_driver tc358762_driver = {
 	.probe = tc358762_probe,
-	.remove = tc358762_remove,
 	.driver = {
 		.name = "tc358762",
 		.of_match_table = tc358762_of_match,
-- 
2.43.0


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

* [PATCH 2/2] drm/bridge: tc358764: use devm for bridge registration and DSI attach
  2026-05-21 21:52 [PATCH 1/2] drm/bridge: tc358762: use devm for bridge registration and DSI attach Osama Abdelkader
@ 2026-05-21 21:52 ` Osama Abdelkader
  2026-07-06 12:59 ` [PATCH 1/2] drm/bridge: tc358762: " Osama Abdelkader
  1 sibling, 0 replies; 3+ messages in thread
From: Osama Abdelkader @ 2026-05-21 21:52 UTC (permalink / raw)
  To: luca.ceresoli, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel
  Cc: Osama Abdelkader

Replace manual drm_bridge_remove()/mipi_dsi_detach() in remove with
devm_drm_bridge_add() and devm_mipi_dsi_attach() in probe. Also check
the return value from bridge registration.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/bridge/tc358764.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c
index 084e9d898e22..ae652f2eef1b 100644
--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -372,25 +372,17 @@ static int tc358764_probe(struct mipi_dsi_device *dsi)
 	ctx->bridge.of_node = dev->of_node;
 	ctx->bridge.pre_enable_prev_first = true;
 
-	drm_bridge_add(&ctx->bridge);
+	ret = devm_drm_bridge_add(dev, &ctx->bridge);
+	if (ret < 0)
+		return ret;
 
-	ret = mipi_dsi_attach(dsi);
-	if (ret < 0) {
-		drm_bridge_remove(&ctx->bridge);
+	ret = devm_mipi_dsi_attach(dev, dsi);
+	if (ret < 0)
 		dev_err(dev, "failed to attach dsi\n");
-	}
 
 	return ret;
 }
 
-static void tc358764_remove(struct mipi_dsi_device *dsi)
-{
-	struct tc358764 *ctx = mipi_dsi_get_drvdata(dsi);
-
-	mipi_dsi_detach(dsi);
-	drm_bridge_remove(&ctx->bridge);
-}
-
 static const struct of_device_id tc358764_of_match[] = {
 	{ .compatible = "toshiba,tc358764" },
 	{ }
@@ -399,7 +391,6 @@ MODULE_DEVICE_TABLE(of, tc358764_of_match);
 
 static struct mipi_dsi_driver tc358764_driver = {
 	.probe = tc358764_probe,
-	.remove = tc358764_remove,
 	.driver = {
 		.name = "tc358764",
 		.of_match_table = tc358764_of_match,
-- 
2.43.0


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

* Re: [PATCH 1/2] drm/bridge: tc358762: use devm for bridge registration and DSI attach
  2026-05-21 21:52 [PATCH 1/2] drm/bridge: tc358762: use devm for bridge registration and DSI attach Osama Abdelkader
  2026-05-21 21:52 ` [PATCH 2/2] drm/bridge: tc358764: " Osama Abdelkader
@ 2026-07-06 12:59 ` Osama Abdelkader
  1 sibling, 0 replies; 3+ messages in thread
From: Osama Abdelkader @ 2026-07-06 12:59 UTC (permalink / raw)
  To: luca.ceresoli, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel

On Thu, May 21, 2026 at 11:52:26PM +0200, Osama Abdelkader wrote:
> Replace manual drm_bridge_remove()/mipi_dsi_detach() in remove with
> devm_drm_bridge_add() and devm_mipi_dsi_attach() in probe. Also check
> the return value from bridge registration.
> 
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> ---
>  drivers/gpu/drm/bridge/tc358762.c | 19 +++++--------------
>  1 file changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c
> index 3d75d9cfa45e..3a021ca895f1 100644
> --- a/drivers/gpu/drm/bridge/tc358762.c
> +++ b/drivers/gpu/drm/bridge/tc358762.c
> @@ -293,25 +293,17 @@ static int tc358762_probe(struct mipi_dsi_device *dsi)
>  	ctx->bridge.of_node = dev->of_node;
>  	ctx->bridge.pre_enable_prev_first = true;
>  
> -	drm_bridge_add(&ctx->bridge);
> +	ret = devm_drm_bridge_add(dev, &ctx->bridge);
> +	if (ret < 0)
> +		return ret;
>  
> -	ret = mipi_dsi_attach(dsi);
> -	if (ret < 0) {
> -		drm_bridge_remove(&ctx->bridge);
> +	ret = devm_mipi_dsi_attach(dev, dsi);
> +	if (ret < 0)
>  		dev_err(dev, "failed to attach dsi\n");
> -	}
>  
>  	return ret;
>  }
>  
> -static void tc358762_remove(struct mipi_dsi_device *dsi)
> -{
> -	struct tc358762 *ctx = mipi_dsi_get_drvdata(dsi);
> -
> -	mipi_dsi_detach(dsi);
> -	drm_bridge_remove(&ctx->bridge);
> -}
> -
>  static const struct of_device_id tc358762_of_match[] = {
>  	{ .compatible = "toshiba,tc358762" },
>  	{ }
> @@ -320,7 +312,6 @@ MODULE_DEVICE_TABLE(of, tc358762_of_match);
>  
>  static struct mipi_dsi_driver tc358762_driver = {
>  	.probe = tc358762_probe,
> -	.remove = tc358762_remove,
>  	.driver = {
>  		.name = "tc358762",
>  		.of_match_table = tc358762_of_match,
> -- 
> 2.43.0
> 

ping.

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

end of thread, other threads:[~2026-07-06 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 21:52 [PATCH 1/2] drm/bridge: tc358762: use devm for bridge registration and DSI attach Osama Abdelkader
2026-05-21 21:52 ` [PATCH 2/2] drm/bridge: tc358764: " Osama Abdelkader
2026-07-06 12:59 ` [PATCH 1/2] drm/bridge: tc358762: " Osama Abdelkader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox