drm/panel: Use devm_mipi_dsi_attach in BOE panels
Subsystems (29)
PATCH v3 1/6 drm/panel: Use devm_mipi_dsi_attach in BOE panels
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
---
v3:
- Move the changelog after the ---.
v2:
- break long description lines.
- add Signed-off-by tag
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 8 +------- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 8 +------- drivers/gpu/drm/panel/panel-boe-td4320.c | 8 +------- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 4 +--- drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c | 8 +------- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 +------ 6 files changed, 6 insertions(+), 37 deletions(-)
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +1 -7
@@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&boe->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;
@@ -371,12 +371,6 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)static void boe_bf060y8m_aj0_remove (struct mipi_dsi_device *dsi) {struct boe_bf060y8m_aj0 *boe =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&boe->panel); }
drivers/gpu/drm/panel/panel-boe-himax8279d.c +1 -7
@@ -881,7 +881,7 @@ static int panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err <0 )drm_panel_remove (&pinfo->base);
@@ -891,12 +891,6 @@ static int panel_probe(struct mipi_dsi_device *dsi)static void panel_remove (struct mipi_dsi_device *dsi) {struct panel_info *pinfo =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err); -drm_panel_remove (&pinfo->base); }
drivers/gpu/drm/panel/panel-boe-td4320.c +1 -7
@@ -204,7 +204,7 @@ static int boe_td4320_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -216,12 +216,6 @@ static int boe_td4320_probe(struct mipi_dsi_device *dsi)static void boe_td4320_remove (struct mipi_dsi_device *dsi) {struct boe_td4320 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c +1 -3
@@ -393,7 +393,7 @@ static int boe_th101mb31ig002_dsi_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err_probe (&dsi->dev, ret,"Failed to attach panel to DSI host\n" );
@@ -407,8 +407,6 @@ static int boe_th101mb31ig002_dsi_probe(struct mipi_dsi_device *dsi)static void boe_th101mb31ig002_dsi_remove (struct mipi_dsi_device *dsi) {struct boe_th101mb31ig002 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c +1 -7
@@ -200,7 +200,7 @@ static int boe_tv101wum_ll2_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -212,12 +212,6 @@ static int boe_tv101wum_ll2_probe(struct mipi_dsi_device *dsi)static void boe_tv101wum_ll2_remove (struct mipi_dsi_device *dsi) {struct boe_tv101wum_ll2 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +1 -6
@@ -1765,7 +1765,7 @@ static int boe_panel_probe(struct mipi_dsi_device *dsi)mipi_dsi_set_drvdata (dsi, boe); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret)drm_panel_remove (&boe->base);
@@ -1775,11 +1775,6 @@ static int boe_panel_probe(struct mipi_dsi_device *dsi)static void boe_panel_remove (struct mipi_dsi_device *dsi) {struct boe_panel *boe =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret);if (boe->base.dev)drm_panel_remove (&boe->base);
Signature · 1 line
2.43.0
PATCH v3 2/6 drm/panel: Use devm_mipi_dsi_attach in Samsung panels
Use the managed MIPI DSI attach helper in Samsung panel drivers and drop the corresponding manual detach calls from remove paths.
---
v3:
- Move the changelog after the ---.
v2:
- break long description lines.
- add Signed-off-by tag
drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 4 +--- drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-s6e3fc2x01.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 4 +--- drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 4 +--- drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c | 3 +-- drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 4 +--- drivers/gpu/drm/panel/panel-samsung-s6e8fc0-m1906f9.c | 8 +------- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 8 +------- 13 files changed, 13 insertions(+), 70 deletions(-)
drivers/gpu/drm/panel/panel-samsung-s6d16d0.c +1 -3
@@ -209,7 +209,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&s6->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )drm_panel_remove (&s6->panel);
@@ -219,8 +219,6 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)static void s6d16d0_remove (struct mipi_dsi_device *dsi) {struct s6d16d0 *s6 =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&s6->panel); }
drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +1 -7
@@ -438,7 +438,7 @@ static int s6d7aa0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -451,12 +451,6 @@ static int s6d7aa0_probe(struct mipi_dsi_device *dsi)static void s6d7aa0_remove (struct mipi_dsi_device *dsi) {struct s6d7aa0 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e3fa7.c +1 -7
@@ -213,7 +213,7 @@ static int s6e3fa7_panel_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -226,12 +226,6 @@ static int s6e3fa7_panel_probe(struct mipi_dsi_device *dsi)static void s6e3fa7_panel_remove (struct mipi_dsi_device *dsi) {struct s6e3fa7_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e3fc2x01.c +1 -7
@@ -342,7 +342,7 @@ static int s6e3fc2x01_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -355,12 +355,6 @@ static int s6e3fc2x01_probe(struct mipi_dsi_device *dsi)static void s6e3fc2x01_remove (struct mipi_dsi_device *dsi) {struct samsung_s6e3fc2x01 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +1 -3
@@ -737,7 +737,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) goto remove_panel;
@@ -753,8 +753,6 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)static void s6e3ha2_remove (struct mipi_dsi_device *dsi) {struct s6e3ha2 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel);backlight_device_unregister (ctx->bl_dev); }
drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c +1 -7
@@ -299,7 +299,7 @@ static int s6e3ha8_amb577px01_wqhd_probe(struct mipi_dsi_device *dsi) priv->dsc.bits_per_pixel =8 <<4 ;/* 4 fractional bits */ priv->dsc.block_pred_enable = true; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&priv->panel);
@@ -312,12 +312,6 @@ static int s6e3ha8_amb577px01_wqhd_probe(struct mipi_dsi_device *dsi)static void s6e3ha8_amb577px01_wqhd_remove (struct mipi_dsi_device *dsi) {struct s6e3ha8 *priv =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&priv->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +1 -3
@@ -477,7 +477,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) goto remove_panel;
@@ -493,8 +493,6 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)static void s6e63j0x03_remove (struct mipi_dsi_device *dsi) {struct s6e63j0x03 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel);backlight_device_unregister (ctx->bl_dev);
drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c +1 -2
@@ -105,7 +105,7 @@ static int s6e63m0_dsi_probe(struct mipi_dsi_device *dsi)if (ret)return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )s6e63m0_remove (dev);
@@ -114,7 +114,6 @@ static int s6e63m0_dsi_probe(struct mipi_dsi_device *dsi)static void s6e63m0_dsi_remove (struct mipi_dsi_device *dsi) { -mipi_dsi_detach (dsi);s6e63m0_remove (&dsi->dev); }
drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams427ap24.c +1 -7
@@ -724,7 +724,7 @@ static int s6e88a0_ams427ap24_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -737,12 +737,6 @@ static int s6e88a0_ams427ap24_probe(struct mipi_dsi_device *dsi)static void s6e88a0_ams427ap24_remove (struct mipi_dsi_device *dsi) {struct s6e88a0_ams427ap24 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c +1 -7
@@ -196,7 +196,7 @@ static int s6e88a0_ams452ef01_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -209,12 +209,6 @@ static int s6e88a0_ams452ef01_probe(struct mipi_dsi_device *dsi)static void s6e88a0_ams452ef01_remove (struct mipi_dsi_device *dsi) {struct s6e88a0_ams452ef01 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +1 -3
@@ -1020,7 +1020,7 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )drm_panel_remove (&ctx->panel);
@@ -1030,8 +1030,6 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)static void s6e8aa0_remove (struct mipi_dsi_device *dsi) {struct s6e8aa0 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-s6e8fc0-m1906f9.c +1 -7
@@ -258,7 +258,7 @@ static int s6e8fc0_m1906f9_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -270,12 +270,6 @@ static int s6e8fc0_m1906f9_probe(struct mipi_dsi_device *dsi)static void s6e8fc0_remove (struct mipi_dsi_device *dsi) {struct s6e8fc0_ctx *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-samsung-sofef00.c +1 -7
@@ -252,7 +252,7 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -265,12 +265,6 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)static void sofef00_panel_remove (struct mipi_dsi_device *dsi) {struct sofef00_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
Signature · 1 line
2.43.0
PATCH v3 3/6 drm/panel: Use devm_mipi_dsi_attach in Novatek and Raydium panels
In reply to Osama AbdelkaderUse the managed MIPI DSI attach helper in Novatek and Raydium panel drivers and drop the corresponding manual detach calls from remove paths.
---
v3:
- Move the changelog after the ---.
v2:
- break long description lines.
- add Signed-off-by tag
drivers/gpu/drm/panel/panel-novatek-nt35510.c | 4 +--- drivers/gpu/drm/panel/panel-novatek-nt35532.c | 8 +------- drivers/gpu/drm/panel/panel-novatek-nt35560.c | 4 +--- drivers/gpu/drm/panel/panel-novatek-nt36672a.c | 8 +------- drivers/gpu/drm/panel/panel-novatek-nt36672e.c | 4 +--- drivers/gpu/drm/panel/panel-novatek-nt37700f.c | 8 +------- drivers/gpu/drm/panel/panel-novatek-nt37801.c | 8 +------- drivers/gpu/drm/panel/panel-raydium-rm67191.c | 8 +------- drivers/gpu/drm/panel/panel-raydium-rm67200.c | 8 +------- drivers/gpu/drm/panel/panel-raydium-rm68200.c | 4 +--- drivers/gpu/drm/panel/panel-raydium-rm692e5.c | 8 +------- 11 files changed, 11 insertions(+), 61 deletions(-)
drivers/gpu/drm/panel/panel-novatek-nt35510.c +1 -3
@@ -1175,7 +1175,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)drm_panel_add (&nt->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )drm_panel_remove (&nt->panel);
@@ -1186,8 +1186,6 @@ static void nt35510_remove(struct mipi_dsi_device *dsi) {struct nt35510 *nt =mipi_dsi_get_drvdata (dsi);int ret; - -mipi_dsi_detach (dsi);/* Power off */ ret =nt35510_power_off (nt);if (ret)
drivers/gpu/drm/panel/panel-novatek-nt35532.c +1 -7
@@ -754,7 +754,7 @@ static int nt35532_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -766,12 +766,6 @@ static int nt35532_probe(struct mipi_dsi_device *dsi)static void nt35532_remove (struct mipi_dsi_device *dsi) {struct novatek_nt35532 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-novatek-nt35560.c +1 -3
@@ -435,7 +435,7 @@ static int nt35560_probe(struct mipi_dsi_device *dsi)drm_panel_add (&nt->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&nt->panel);return ret;
@@ -447,8 +447,6 @@ static int nt35560_probe(struct mipi_dsi_device *dsi)static void nt35560_remove (struct mipi_dsi_device *dsi) {struct nt35560 *nt =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&nt->panel); }
drivers/gpu/drm/panel/panel-novatek-nt36672a.c +1 -7
@@ -458,7 +458,7 @@ static int nt36672a_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err <0 ) {drm_panel_remove (&pinfo->base);return err;
@@ -470,12 +470,6 @@ static int nt36672a_panel_probe(struct mipi_dsi_device *dsi)static void nt36672a_panel_remove (struct mipi_dsi_device *dsi) {struct nt36672a_panel *pinfo =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err); -drm_panel_remove (&pinfo->base); }
drivers/gpu/drm/panel/panel-novatek-nt36672e.c +1 -3
@@ -563,7 +563,7 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret); goto err_dsi_attach;
@@ -579,8 +579,6 @@ static int nt36672e_panel_probe(struct mipi_dsi_device *dsi)static void nt36672e_panel_remove (struct mipi_dsi_device *dsi) {struct nt36672e_panel *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (ctx->dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-novatek-nt37700f.c +1 -7
@@ -259,7 +259,7 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -271,12 +271,6 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)static void nt37700f_tianma_remove (struct mipi_dsi_device *dsi) {struct nt37700f_tianma *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-novatek-nt37801.c +1 -7
@@ -283,7 +283,7 @@ static int novatek_nt37801_probe(struct mipi_dsi_device *dsi) ctx->dsc.bits_per_pixel =8 <<4 ;/* 4 fractional bits */ ctx->dsc.block_pred_enable = true; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -295,12 +295,6 @@ static int novatek_nt37801_probe(struct mipi_dsi_device *dsi)static void novatek_nt37801_remove (struct mipi_dsi_device *dsi) {struct novatek_nt37801 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-raydium-rm67191.c +1 -7
@@ -592,7 +592,7 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi)drm_panel_add (&panel->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret)drm_panel_remove (&panel->panel);
@@ -602,12 +602,6 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi)static void rad_panel_remove (struct mipi_dsi_device *dsi) {struct rad_panel *rad =mipi_dsi_get_drvdata (dsi); -struct device *dev = &dsi->dev; -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret) -dev_err (dev,"Failed to detach from host (%d)\n" , ret);drm_panel_remove (&rad->panel); }
drivers/gpu/drm/panel/panel-raydium-rm67200.c +1 -7
@@ -422,7 +422,7 @@ static int raydium_rm67200_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -434,12 +434,6 @@ static int raydium_rm67200_probe(struct mipi_dsi_device *dsi)static void raydium_rm67200_remove (struct mipi_dsi_device *dsi) {struct raydium_rm67200 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-raydium-rm68200.c +1 -3
@@ -362,7 +362,7 @@ static int rm68200_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach() failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -375,8 +375,6 @@ static int rm68200_probe(struct mipi_dsi_device *dsi)static void rm68200_remove (struct mipi_dsi_device *dsi) {struct rm68200 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-raydium-rm692e5.c +1 -7
@@ -331,7 +331,7 @@ static int rm692e5_probe(struct mipi_dsi_device *dsi) ctx->dsc.bits_per_pixel =8 <<4 ;/* 4 fractional bits */ ctx->dsc.block_pred_enable = true; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -344,12 +344,6 @@ static int rm692e5_probe(struct mipi_dsi_device *dsi)static void rm692e5_remove (struct mipi_dsi_device *dsi) {struct rm692e5_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
Signature · 1 line
2.43.0
PATCH v3 4/6 drm/panel: Use devm_mipi_dsi_attach in Himax and Ilitek panels
In reply to Osama AbdelkaderUse the managed MIPI DSI attach helper in Himax and Ilitek panel drivers and drop the corresponding manual detach calls from remove paths.
---
v3:
- Move the changelog after the ---.
v2:
- break long description lines.
- add Signed-off-by tag
drivers/gpu/drm/panel/panel-himax-hx83102.c | 7 +------ drivers/gpu/drm/panel/panel-himax-hx83112a.c | 8 +------- drivers/gpu/drm/panel/panel-himax-hx83112b.c | 8 +------- drivers/gpu/drm/panel/panel-himax-hx8394.c | 8 +------- drivers/gpu/drm/panel/panel-ilitek-ili9805.c | 9 +-------- drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c | 3 +-- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 4 +--- drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 7 +------ 8 files changed, 8 insertions(+), 46 deletions(-)
drivers/gpu/drm/panel/panel-himax-hx83102.c +1 -6
@@ -1318,7 +1318,7 @@ static int hx83102_probe(struct mipi_dsi_device *dsi)mipi_dsi_set_drvdata (dsi, ctx); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret)drm_panel_remove (&ctx->base);
@@ -1328,11 +1328,6 @@ static int hx83102_probe(struct mipi_dsi_device *dsi)static void hx83102_remove (struct mipi_dsi_device *dsi) {struct hx83102 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret);if (ctx->base.dev)drm_panel_remove (&ctx->base);
drivers/gpu/drm/panel/panel-himax-hx83112a.c +1 -7
@@ -305,7 +305,7 @@ static int hx83112a_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );drm_panel_remove (&ctx->panel);
@@ -318,12 +318,6 @@ static int hx83112a_probe(struct mipi_dsi_device *dsi)static void hx83112a_remove (struct mipi_dsi_device *dsi) {struct hx83112a_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-himax-hx83112b.c +1 -7
@@ -388,7 +388,7 @@ static int hx83112b_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -400,12 +400,6 @@ static int hx83112b_probe(struct mipi_dsi_device *dsi)static void hx83112b_remove (struct mipi_dsi_device *dsi) {struct hx83112b_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-himax-hx8394.c +1 -7
@@ -1025,7 +1025,7 @@ static int hx8394_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err_probe (dev, ret,"mipi_dsi_attach failed\n" );drm_panel_remove (&ctx->panel);
@@ -1043,12 +1043,6 @@ static int hx8394_probe(struct mipi_dsi_device *dsi)static void hx8394_remove (struct mipi_dsi_device *dsi) {struct hx8394 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-ilitek-ili9805.c +1 -8
@@ -307,7 +307,7 @@ static int ili9805_dsi_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (&dsi->dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -320,13 +320,6 @@ static int ili9805_dsi_probe(struct mipi_dsi_device *dsi)static void ili9805_dsi_remove (struct mipi_dsi_device *dsi) {struct ili9805 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , - ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c +1 -2
@@ -141,7 +141,7 @@ static int ili9806e_dsi_probe(struct mipi_dsi_device *dsi)if (ret)return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );ili9806e_remove (dev);
@@ -153,7 +153,6 @@ static int ili9806e_dsi_probe(struct mipi_dsi_device *dsi)static void ili9806e_dsi_remove (struct mipi_dsi_device *dsi) { -mipi_dsi_detach (dsi);ili9806e_remove (&dsi->dev); }
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +1 -3
@@ -2597,14 +2597,12 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->lanes = ctx->desc->lanes; -return mipi_dsi_attach (dsi); +return devm_mipi_dsi_attach (&dsi->dev, dsi); }static void ili9881c_dsi_remove (struct mipi_dsi_device *dsi) {struct ili9881c *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-ilitek-ili9882t.c +1 -6
@@ -844,7 +844,7 @@ static int ili9882t_probe(struct mipi_dsi_device *dsi)mipi_dsi_set_drvdata (dsi, ili); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret)drm_panel_remove (&ili->base);
@@ -854,11 +854,6 @@ static int ili9882t_probe(struct mipi_dsi_device *dsi)static void ili9882t_remove (struct mipi_dsi_device *dsi) {struct ili9882t *ili =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret);if (ili->base.dev)drm_panel_remove (&ili->base);
Signature · 1 line
2.43.0
PATCH v3 5/6 drm/panel: Use devm_mipi_dsi_attach in display vendor panels
In reply to Osama AbdelkaderUse the managed MIPI DSI attach helper in JDI, Sharp, Sony, Visionox and Leadtek panel drivers and drop the corresponding manual detach calls from remove paths.
---
v3:
- Move the changelog after the ---.
v2:
- break long description lines.
- add Signed-off-by tag
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 8 +------- drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 8 +------- drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 8 +------- drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c | 8 +------- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 7 +------ drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c | 8 +------- drivers/gpu/drm/panel/panel-sony-td4353-jdi.c | 8 +------- drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c | 8 +------- drivers/gpu/drm/panel/panel-visionox-r66451.c | 8 +------- drivers/gpu/drm/panel/panel-visionox-rm69299.c | 4 +--- 10 files changed, 10 insertions(+), 65 deletions(-)
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c +1 -7
@@ -202,7 +202,7 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;
@@ -214,12 +214,6 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi)static void jdi_fhd_r63452_remove (struct mipi_dsi_device *dsi) {struct jdi_fhd_r63452 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +1 -7
@@ -380,7 +380,7 @@ static int jdi_panel_probe(struct mipi_dsi_device *dsi)if (ret <0 )return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {jdi_panel_del (jdi);return ret;
@@ -392,12 +392,6 @@ static int jdi_panel_probe(struct mipi_dsi_device *dsi)static void jdi_panel_remove (struct mipi_dsi_device *dsi) {struct jdi_panel *jdi =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , - ret);jdi_panel_del (jdi); }
drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c +1 -7
@@ -585,7 +585,7 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -598,12 +598,6 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)static void ltk050h3146w_remove (struct mipi_dsi_device *dsi) {struct ltk050h3146w *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-leadtek-ltk500hd1829.c +1 -7
@@ -651,7 +651,7 @@ static int ltk500hd1829_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -664,12 +664,6 @@ static int ltk500hd1829_probe(struct mipi_dsi_device *dsi)static void ltk500hd1829_remove (struct mipi_dsi_device *dsi) {struct ltk500hd1829 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +1 -6
@@ -244,7 +244,7 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi)if (ret <0 )return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {sharp_nt_panel_del (sharp_nt);return ret;
@@ -256,11 +256,6 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi)static void sharp_nt_panel_remove (struct mipi_dsi_device *dsi) {struct sharp_nt_panel *sharp_nt =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret);sharp_nt_panel_del (sharp_nt); }
drivers/gpu/drm/panel/panel-sharp-ls060t1sx01.c +1 -7
@@ -235,7 +235,7 @@ static int sharp_ls060_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -248,12 +248,6 @@ static int sharp_ls060_probe(struct mipi_dsi_device *dsi)static void sharp_ls060_remove (struct mipi_dsi_device *dsi) {struct sharp_ls060 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-sony-td4353-jdi.c +1 -7
@@ -216,7 +216,7 @@ static int sony_td4353_jdi_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -229,12 +229,6 @@ static int sony_td4353_jdi_probe(struct mipi_dsi_device *dsi)static void sony_td4353_jdi_remove (struct mipi_dsi_device *dsi) {struct sony_td4353_jdi *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c +1 -7
@@ -474,7 +474,7 @@ static int truly_nt35521_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -487,12 +487,6 @@ static int truly_nt35521_probe(struct mipi_dsi_device *dsi)static void truly_nt35521_remove (struct mipi_dsi_device *dsi) {struct truly_nt35521 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-visionox-r66451.c +1 -7
@@ -306,7 +306,7 @@ static int visionox_r66451_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -318,12 +318,6 @@ static int visionox_r66451_probe(struct mipi_dsi_device *dsi)static void visionox_r66451_remove (struct mipi_dsi_device *dsi) {struct visionox_r66451 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-visionox-rm69299.c +1 -3
@@ -388,7 +388,7 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_LPM |MIPI_DSI_CLOCK_NON_CONTINUOUS ; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"dsi attach failed ret = %d\n" , ret); goto err_dsi_attach;
@@ -404,8 +404,6 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)static void visionox_rm69299_remove (struct mipi_dsi_device *dsi) {struct visionox_rm69299 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (ctx->dsi);drm_panel_remove (&ctx->panel); }
Signature · 1 line
2.43.0
PATCH v3 6/6 drm/panel: Use devm_mipi_dsi_attach in assorted panels
In reply to Osama AbdelkaderUse the managed MIPI DSI attach helper in the remaining straightforward panel drivers and drop the corresponding manual detach calls from remove paths.
---
v3:
- Move the changelog after the ---.
v2:
- break long description lines.
- add Signed-off-by tag
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c | 9 +-------- drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c | 8 +------- drivers/gpu/drm/panel/panel-dsi-cm.c | 4 +--- drivers/gpu/drm/panel/panel-ebbg-ft8719.c | 8 +------- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 +------- drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c | 4 +--- drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 4 +--- drivers/gpu/drm/panel/panel-hydis-hv101hd1.c | 9 +-------- drivers/gpu/drm/panel/panel-innolux-p079zca.c | 8 +------- drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c | 4 +--- drivers/gpu/drm/panel/panel-khadas-ts050.c | 8 +------- drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c | 7 +------ drivers/gpu/drm/panel/panel-lg-sw43408.c | 8 +------- drivers/gpu/drm/panel/panel-lincolntech-lcd197.c | 8 +------- drivers/gpu/drm/panel/panel-lxd-m9189a.c | 8 +------- drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 4 +--- drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 8 +------- drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 4 +--- drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c | 8 +------- drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 7 +------ drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 4 +--- drivers/gpu/drm/panel/panel-simple.c | 8 +------- drivers/gpu/drm/panel/panel-sitronix-st7701.c | 3 +-- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 8 +------- drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c | 8 +------- drivers/gpu/drm/panel/panel-summit.c | 4 +--- drivers/gpu/drm/panel/panel-synaptics-r63353.c | 8 +------- drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 8 +------- drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c | 8 +------- 29 files changed, 29 insertions(+), 166 deletions(-)
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c +1 -8
@@ -264,7 +264,7 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;
@@ -276,13 +276,6 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)static void tm5p5_nt35596_remove (struct mipi_dsi_device *dsi) {struct tm5p5_nt35596 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev, -"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-chipwealth-ch13726a.c +1 -7
@@ -292,7 +292,7 @@ static int ch13726a_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -305,12 +305,6 @@ static int ch13726a_probe(struct mipi_dsi_device *dsi)static void ch13726a_remove (struct mipi_dsi_device *dsi) {struct ch13726a_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-dsi-cm.c +1 -3
@@ -561,7 +561,7 @@ static int dsicm_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ddata->panel); - r =mipi_dsi_attach (dsi); + r =devm_mipi_dsi_attach (&dsi->dev, dsi);if (r <0 ) goto err_dsi_attach;
@@ -583,8 +583,6 @@ static void dsicm_remove(struct mipi_dsi_device *dsi)dev_dbg (&dsi->dev,"remove\n" ); -mipi_dsi_detach (dsi); -drm_panel_remove (&ddata->panel);sysfs_remove_group (&dsi->dev.kobj, &dsicm_attr_group);
drivers/gpu/drm/panel/panel-ebbg-ft8719.c +1 -7
@@ -204,7 +204,7 @@ static int ebbg_ft8719_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -217,12 +217,6 @@ static int ebbg_ft8719_probe(struct mipi_dsi_device *dsi)static void ebbg_ft8719_remove (struct mipi_dsi_device *dsi) {struct ebbg_ft8719 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-elida-kd35t133.c +1 -7
@@ -256,7 +256,7 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -269,12 +269,6 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)static void kd35t133_remove (struct mipi_dsi_device *dsi) {struct kd35t133 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c +1 -3
@@ -474,7 +474,7 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->lanes =4 ; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return ret;
@@ -486,8 +486,6 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi)static void k101_im2ba02_dsi_remove (struct mipi_dsi_device *dsi) {struct k101_im2ba02 *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c +1 -3
@@ -219,7 +219,7 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->lanes =4 ; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return ret;
@@ -231,8 +231,6 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)static void feiyang_dsi_remove (struct mipi_dsi_device *dsi) {struct feiyang *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-hydis-hv101hd1.c +1 -8
@@ -144,7 +144,7 @@ static int hv101hd1_probe(struct mipi_dsi_device *dsi)drm_panel_add (&hv->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret) {drm_panel_remove (&hv->panel);return dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );
@@ -156,13 +156,6 @@ static int hv101hd1_probe(struct mipi_dsi_device *dsi)static void hv101hd1_remove (struct mipi_dsi_device *dsi) {struct hv101hd1 *hv =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev, -"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&hv->panel); }
drivers/gpu/drm/panel/panel-innolux-p079zca.c +1 -7
@@ -444,7 +444,7 @@ static int innolux_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err <0 ) { innolux =mipi_dsi_get_drvdata (dsi);innolux_panel_del (innolux);
@@ -457,12 +457,6 @@ static int innolux_panel_probe(struct mipi_dsi_device *dsi)static void innolux_panel_remove (struct mipi_dsi_device *dsi) {struct innolux_panel *innolux =mipi_dsi_get_drvdata (dsi); -int err; - - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err);innolux_panel_del (innolux); }
drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +1 -3
@@ -3251,7 +3251,7 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi) jadard->dsi = dsi; jadard->desc = desc; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )drm_panel_remove (&jadard->panel);
@@ -3261,8 +3261,6 @@ static int jadard_dsi_probe(struct mipi_dsi_device *dsi)static void jadard_dsi_remove (struct mipi_dsi_device *dsi) {struct jadard *jadard =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&jadard->panel); }
drivers/gpu/drm/panel/panel-khadas-ts050.c +1 -7
@@ -862,7 +862,7 @@ static int khadas_ts050_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err)drm_panel_remove (&khadas_ts050->base);
@@ -872,12 +872,6 @@ static int khadas_ts050_panel_probe(struct mipi_dsi_device *dsi)static void khadas_ts050_panel_remove (struct mipi_dsi_device *dsi) {struct khadas_ts050_panel *khadas_ts050 =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err); -drm_panel_remove (&khadas_ts050->base); }
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c +1 -6
@@ -375,7 +375,7 @@ static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err <0 ) {kingdisplay_panel_del (kingdisplay);return err;
@@ -387,11 +387,6 @@ static int kingdisplay_panel_probe(struct mipi_dsi_device *dsi)static void kingdisplay_panel_remove (struct mipi_dsi_device *dsi) {struct kingdisplay_panel *kingdisplay =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err);kingdisplay_panel_del (kingdisplay); }
drivers/gpu/drm/panel/panel-lg-sw43408.c +1 -7
@@ -294,18 +294,12 @@ static int sw43408_probe(struct mipi_dsi_device *dsi) dsi->dsc = &ctx->dsc; -return mipi_dsi_attach (dsi); +return devm_mipi_dsi_attach (&dsi->dev, dsi); }static void sw43408_remove (struct mipi_dsi_device *dsi) {struct sw43408_panel *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->base); }
drivers/gpu/drm/panel/panel-lincolntech-lcd197.c +1 -7
@@ -221,7 +221,7 @@ static int lincoln_lcd197_panel_probe(struct mipi_dsi_device *dsi)return err;drm_panel_add (&lcd->panel); - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err)drm_panel_remove (&lcd->panel);
@@ -231,12 +231,6 @@ static int lincoln_lcd197_panel_probe(struct mipi_dsi_device *dsi)static void lincoln_lcd197_panel_remove (struct mipi_dsi_device *dsi) {struct lincoln_lcd197_panel *lcd =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err); -drm_panel_remove (&lcd->panel); }
drivers/gpu/drm/panel/panel-lxd-m9189a.c +1 -7
@@ -202,7 +202,7 @@ static int lxd_m9189_probe(struct mipi_dsi_device *dsi)drm_panel_add (&m9189->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err_probe (dev, ret,"Failed to attach to DSI host\n" );drm_panel_remove (&m9189->panel);
@@ -215,12 +215,6 @@ static int lxd_m9189_probe(struct mipi_dsi_device *dsi)static void lxd_m9189_remove (struct mipi_dsi_device *dsi) {struct m9189_panel *m9189 =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&m9189->panel); }
drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +1 -3
@@ -280,7 +280,7 @@ static int mantix_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed (%d). Is host ready?\n" , ret);drm_panel_remove (&ctx->panel);
@@ -298,8 +298,6 @@ static int mantix_probe(struct mipi_dsi_device *dsi)static void mantix_remove (struct mipi_dsi_device *dsi) {struct mantix *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-newvision-nv3051d.c +1 -7
@@ -399,7 +399,7 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -421,14 +421,8 @@ static void panel_nv3051d_shutdown(struct mipi_dsi_device *dsi)static void panel_nv3051d_remove (struct mipi_dsi_device *dsi) {struct panel_nv3051d *ctx =mipi_dsi_get_drvdata (dsi); -int ret; -panel_nv3051d_shutdown (dsi); - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +1 -3
@@ -434,7 +434,7 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed. Is host ready?\n" );drm_panel_remove (&ctx->panel);
@@ -447,8 +447,6 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)static void otm8009a_remove (struct mipi_dsi_device *dsi) {struct otm8009a *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c +1 -7
@@ -172,7 +172,7 @@ static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi)if (ret <0 )return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret)drm_panel_remove (&osd101t2587->base);
@@ -182,13 +182,7 @@ static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi)static void osd101t2587_panel_remove (struct mipi_dsi_device *dsi) {struct osd101t2587_panel *osd101t2587 =mipi_dsi_get_drvdata (dsi); -int ret; -drm_panel_remove (&osd101t2587->base); - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret); }static struct mipi_dsi_driver osd101t2587_panel_driver = {
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +1 -6
@@ -210,7 +210,7 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi)if (ret <0 )return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {wuxga_nt_panel_del (wuxga_nt);return ret;
@@ -222,11 +222,6 @@ static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi)static void wuxga_nt_panel_remove (struct mipi_dsi_device *dsi) {struct wuxga_nt_panel *wuxga_nt =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , ret);wuxga_nt_panel_del (wuxga_nt); }
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +1 -3
@@ -198,7 +198,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->lanes =4 ; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {drm_panel_remove (&ctx->panel);return ret;
@@ -210,8 +210,6 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)static void rb070d30_panel_dsi_remove (struct mipi_dsi_device *dsi) {struct rb070d30_panel *ctx =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&ctx->panel); }
drivers/gpu/drm/panel/panel-simple.c +1 -7
@@ -6551,7 +6551,7 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) dsi->format = desc->format; dsi->lanes = desc->lanes; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err) {struct panel_simple *panel =mipi_dsi_get_drvdata (dsi);
@@ -6563,12 +6563,6 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)static void panel_simple_dsi_remove (struct mipi_dsi_device *dsi) { -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err); -panel_simple_remove (&dsi->dev); }
drivers/gpu/drm/panel/panel-sitronix-st7701.c +1 -2
@@ -1347,7 +1347,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) dsi->format = st7701->desc->format; dsi->lanes = st7701->desc->lanes; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);if (err)return dev_err_probe (&dsi->dev, err,"Failed to init MIPI DSI\n" );
@@ -1381,7 +1381,6 @@ static int st7701_spi_probe(struct spi_device *spi)static void st7701_dsi_remove (struct mipi_dsi_device *dsi) { -mipi_dsi_detach (dsi); }static const struct of_device_id st7701_dsi_of_match[] = {
drivers/gpu/drm/panel/panel-sitronix-st7703.c +1 -7
@@ -979,7 +979,7 @@ static int st7703_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed (%d). Is host ready?\n" , ret);drm_panel_remove (&ctx->panel);
@@ -998,12 +998,6 @@ static int st7703_probe(struct mipi_dsi_device *dsi)static void st7703_remove (struct mipi_dsi_device *dsi) {struct st7703 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel);st7703_debugfs_remove (ctx);
drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c +1 -7
@@ -315,7 +315,7 @@ static int stk_panel_probe(struct mipi_dsi_device *dsi)if (ret <0 )return ret; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )drm_panel_remove (&stk->base);
@@ -325,12 +325,6 @@ static int stk_panel_probe(struct mipi_dsi_device *dsi)static void stk_panel_remove (struct mipi_dsi_device *dsi) {struct stk_panel *stk =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , - err);drm_panel_remove (&stk->base); }
drivers/gpu/drm/panel/panel-summit.c +1 -3
@@ -90,14 +90,12 @@ static int summit_probe(struct mipi_dsi_device *dsi)drm_panel_add (&s_data->panel); -return mipi_dsi_attach (dsi); +return devm_mipi_dsi_attach (&dsi->dev, dsi); }static void summit_remove (struct mipi_dsi_device *dsi) {struct summit_data *s_data =mipi_dsi_get_drvdata (dsi); - -mipi_dsi_detach (dsi);drm_panel_remove (&s_data->panel); }
drivers/gpu/drm/panel/panel-synaptics-r63353.c +1 -7
@@ -267,7 +267,7 @@ static int r63353_panel_probe(struct mipi_dsi_device *dsi)drm_panel_add (&panel->base); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&panel->base);
@@ -281,12 +281,6 @@ static void r63353_panel_remove(struct mipi_dsi_device *dsi) {struct r63353_panel *rpanel =mipi_dsi_get_drvdata (dsi);struct device *dev = &dsi->dev; -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (dev,"Failed to detach from host (%d)\n" , ret); -drm_panel_remove (&rpanel->base); }
drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +1 -7
@@ -195,18 +195,12 @@ static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_device *dsi)if (err <0 )return err; -return mipi_dsi_attach (dsi); +return devm_mipi_dsi_attach (&dsi->dev, dsi); }static void tdo_tl070wsh30_panel_remove (struct mipi_dsi_device *dsi) {struct tdo_tl070wsh30_panel *tdo_tl070wsh30 =mipi_dsi_get_drvdata (dsi); -int err; - - err =mipi_dsi_detach (dsi); -if (err <0 ) -dev_err (&dsi->dev,"failed to detach from DSI host: %d\n" , err); -drm_panel_remove (&tdo_tl070wsh30->base); }
drivers/gpu/drm/panel/panel-xinpeng-xpp055c272.c +1 -7
@@ -276,7 +276,7 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"mipi_dsi_attach failed: %d\n" , ret);drm_panel_remove (&ctx->panel);
@@ -289,12 +289,6 @@ static int xpp055c272_probe(struct mipi_dsi_device *dsi)static void xpp055c272_remove (struct mipi_dsi_device *dsi) {struct xpp055c272 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&ctx->panel); }
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v3 5/6] drm/panel: Use devm_mipi_dsi_attach in display vendor panels
In reply to Osama AbdelkaderThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing drm_panel_remove() on DSI attach failure leaves a dangling pointer in the global panel list. --
--- Patch [5]: [PATCH v3 5/6] drm/panel: Use devm_mipi_dsi_attach in display vendor panels --- commit 861964400906b56ec8ecf322e4a2fb68f45fa468
Author: Osama Abdelkader <[email protected]>
drm/panel: Use devm_mipi_dsi_attach in display vendor panels
This patch converts several MIPI DSI panel drivers to use the managed devm_mipi_dsi_attach() helper and removes the manual detach calls from their respective remove functions.
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi) · line 208
Quoted 12 lines
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c +1
-1@@ -202,7 +202,7 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;
[Severity: High]
This isn't a bug introduced by this patch, but shouldn't we call drm_panel_remove() before returning here?
Since the panel context is allocated using devm_drm_panel_alloc() earlier in jdi_fhd_r63452_probe(), returning an error will cause devres to automatically free the memory.
Because drm_panel_add() was called right before the attach attempt, will this leave a dangling pointer in the global panel_list? It looks like this could result in a use-after-free or list corruption the next time the list is traversed.
Several of the other panel drivers updated in this patch (such as ltk050h3146w) correctly call drm_panel_remove() in this error path.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
[email protected]
AI reviewRe: [PATCH v3 4/6] drm/panel: Use devm_mipi_dsi_attach in Himax and Ilitek panels
In reply to Osama AbdelkaderThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing drm_panel_remove() in the error path of ili9881c_dsi_probe() when devm_mipi_dsi_attach() fails, leaving a dangling pointer in the global panel list and causing a Use-After-Free. --
--- Patch [4]: [PATCH v3 4/6] drm/panel: Use devm_mipi_dsi_attach in Himax and Ilitek panels --- commit 3a10b5f724df17d382396b95194d7b29446eceae
Author: Osama Abdelkader <[email protected]>
drm/panel: Use devm_mipi_dsi_attach in Himax and Ilitek panels
Use the managed MIPI DSI attach helper in Himax and Ilitek panel drivers and drop the corresponding manual detach calls from remove paths.
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) · line 2601
Quoted 11 lines
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +1
-1@@ -2597,14 +2597,12 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->lanes = ctx->desc->lanes; -return mipi_dsi_attach (dsi); +return devm_mipi_dsi_attach (&dsi->dev, dsi); }
[Severity: High]
This is a pre-existing issue, but if devm_mipi_dsi_attach() fails here, does it leave a dangling pointer in the global panel list?
Since ili9881c_dsi_probe() directly returns the result of the attach attempt without calling drm_panel_remove() on failure, and the panel context was allocated with devm_drm_panel_alloc(), the devres cleanup will free the memory while it remains linked in panel_list.
Could this cause a use-after-free when the list is next traversed?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing drm_panel_remove() on devm_mipi_dsi_attach() error path in boe_bf060y8m_aj0_probe() causes a dangling pointer and use-after-free. --
--- Patch [1]: [PATCH v3 1/6] drm/panel: Use devm_mipi_dsi_attach in BOE panels --- commit 1f4d2947471e6cb49ce506f1077843c672e21899
Author: Osama Abdelkader <[email protected]>
drm/panel: Use devm_mipi_dsi_attach in BOE panels
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) · line 365
Quoted 13 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +1
-1@@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&boe->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;
[Severity: High]
This is a pre-existing issue, but should drm_panel_remove(&boe->panel) be called on this error path?
In boe_bf060y8m_aj0_probe(), drm_panel_add() inserts the panel into the global panel_list. If devm_mipi_dsi_attach() fails, the function returns an error without calling drm_panel_remove().
During probe failure, the devres cleanup drops the panel's refcount but it remains in the global panel_list since the refcount doesn't reach zero. If another driver later looks up this panel (e.g., via of_drm_find_panel()) and invokes its operations, it will dereference freed devres-managed resources like boe->reset_gpio, causing a use-after-free.
Other BOE panel drivers updated in this patch seem to correctly handle this cleanup.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AI reviewRe: [PATCH v3 3/6] drm/panel: Use devm_mipi_dsi_attach in Novatek and Raydium panels
In reply to Osama AbdelkaderThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but there is a Use-After-Free in the driver unbind path due to an ignored error return value from devm_mipi_dsi_attach. --
--- Patch [3]: [PATCH v3 3/6] drm/panel: Use devm_mipi_dsi_attach in Novatek and Raydium panels --- commit 4038e87306192174f8d35deb13351bd8c956f7e3
Author: Osama Abdelkader <[email protected]>
drm/panel: Use devm_mipi_dsi_attach in Novatek and Raydium panels
Use the managed MIPI DSI attach helper in Novatek and Raydium panel drivers and drop the corresponding manual detach calls from remove paths.
drivers/gpu/drm/panel/panel-novatek-nt35510.c static int nt35510_probe(struct mipi_dsi_device *dsi) · line 1180
Quoted 12 lines
drivers/gpu/drm/panel/panel-novatek-nt35510.c +1
-1@@ -1175,7 +1175,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)drm_panel_add (&nt->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 )drm_panel_remove (&nt->panel);
[Severity: High]
This is a pre-existing issue, but if devm_mipi_dsi_attach() fails here, drm_panel_remove() is called, but the nt35510_probe() function still returns 0 (success) immediately after this. Because probe succeeds, devres cleanup isn't triggered at probe time.
[ ... ]
drivers/gpu/drm/panel/panel-novatek-nt35510.c static void nt35510_remove(struct mipi_dsi_device *dsi) · line 1190
Quoted 6 lines
drivers/gpu/drm/panel/panel-novatek-nt35510.c +0
-2@@ -1186,8 +1186,6 @@ static void nt35510_remove(struct mipi_dsi_device *dsi) {struct nt35510 *nt =mipi_dsi_get_drvdata (dsi);int ret; - -mipi_dsi_detach (dsi);
[Severity: High]
This isn't a bug introduced by this patch, but when the driver is later unbound, nt35510_remove() calls drm_panel_remove() a second time. This drops the refcount to 0, freeing the panel memory prematurely.
After nt35510_remove() completes, the devres cleanup handlers execute, including drm_panel_put_void(), which will access the already freed panel memory resulting in a use-after-free.
Should nt35510_probe() return the error code instead of 0 when devm_mipi_dsi_attach() fails?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
[email protected]
AI reviewRe: [PATCH v3 6/6] drm/panel: Use devm_mipi_dsi_attach in assorted panels
In reply to Osama AbdelkaderThank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [Low] Unused local variable 'dev' left behind after removing error handling.
Pre-existing issues:
- [High] Missing drm_panel_remove() on devm_mipi_dsi_attach() failure causes Use-After-Free.
- [High] DCS commands sent over a detached DSI bus during st7701 cleanup.
--
--- Patch [6]: [PATCH v3 6/6] drm/panel: Use devm_mipi_dsi_attach in assorted panels --- commit 7405393b6171044f855c59f559f223d4f0b22c36
Author: Osama Abdelkader <[email protected]>
drm/panel: Use devm_mipi_dsi_attach in assorted panels
This commit converts multiple panel drivers to use the managed devm_mipi_dsi_attach helper. It drops the corresponding manual detach calls from the remove paths of these drivers.
Quoted 4 lines
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c +0
-0
[ ... ]
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi) · line 268
Quoted 7 lines
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c +1
-1@@ -264,7 +264,7 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)drm_panel_add (&ctx->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {
[Severity: High]
This isn't a bug introduced by this patch, but if the attach fails here, does this return the error code without calling drm_panel_remove()?
Because the panel struct was allocated using devm_drm_panel_alloc(), devres will automatically free the memory upon probe failure. However, the panel would remain linked in the global panel_list, which could cause a use-after-free when the list is iterated.
This pattern appears to be present in multiple drivers modified in this patch (like panel-lg-sw43408.c, panel-summit.c, and panel-tdo-tl070wsh30.c).
Quoted 3 lines
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c +0
-0dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;}
[ ... ]
Quoted 4 lines
drivers/gpu/drm/panel/panel-sitronix-st7701.c +0
-0
[ ... ]
drivers/gpu/drm/panel/panel-sitronix-st7701.c static int st7701_dsi_probe(struct mipi_dsi_device *dsi) · line 1350
Quoted 6 lines
drivers/gpu/drm/panel/panel-sitronix-st7701.c +1
-1@@ -1347,7 +1347,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) dsi->format = st7701->desc->format; dsi->lanes = st7701->desc->lanes; - err =mipi_dsi_attach (dsi); + err =devm_mipi_dsi_attach (&dsi->dev, dsi);
[Severity: High]
This is a pre-existing issue, but does this lead to DCS commands being sent over a detached DSI bus during cleanup?
The st7701_probe() function registers the st7701_cleanup() devres action which eventually calls drm_panel_unprepare() and sends a sleep command. Because devm_mipi_dsi_attach() is called after st7701_probe(), the detach devres action is registered last.
Since devres executes in LIFO order, the bus will be detached before st7701_cleanup() attempts to send the sleep command.
Quoted 2 lines
drivers/gpu/drm/panel/panel-sitronix-st7701.c +0
-0if (err)return dev_err_probe (&dsi->dev, err,"Failed to init MIPI DSI\n" );
[ ... ]
Quoted 4 lines
drivers/gpu/drm/panel/panel-synaptics-r63353.c +0
-0
[ ... ]
drivers/gpu/drm/panel/panel-synaptics-r63353.c static void r63353_panel_remove(struct mipi_dsi_device *dsi) · line 289
Quoted 10 lines
drivers/gpu/drm/panel/panel-synaptics-r63353.c +0
-6@@ -281,12 +281,6 @@ static void r63353_panel_remove(struct mipi_dsi_device *dsi) {struct r63353_panel *rpanel =mipi_dsi_get_drvdata (dsi);struct device *dev = &dsi->dev; -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (dev,"Failed to detach from host (%d)\n" , ret); -
[Severity: Low]
With the error logging removed, is the dev variable now unused and safe to remove from r63353_panel_remove() to avoid a compiler warning?
Quoted 2 lines
drivers/gpu/drm/panel/panel-synaptics-r63353.c +0
-0drm_panel_remove (&rpanel->base); }
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
Maxime Ripard
maintainerQuoted 36 lines · Osama Abdelkader
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
Signed-off-by Osama Abdelkader <[email protected]>---
v3:
- Move the changelog after the---.v2:
- break long description lines.
- add Signed-off-by tagdrivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 8 +------- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 8 +------- drivers/gpu/drm/panel/panel-boe-td4320.c | 8 +------- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 4 +--- drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c | 8 +------- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 +------ 6 files changed, 6 insertions(+), 37 deletions(-)drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +1
-1@@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&boe->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;@@ -371,12 +371,6 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)static void boe_bf060y8m_aj0_remove (struct mipi_dsi_device *dsi)
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) · line 375
Quoted 10 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +0
-6{struct boe_bf060y8m_aj0 *boe =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&boe->panel); }
mipi_dsi_detach is now called after drm_panel_remove. Your commit log should mention it, and explain why it's not a concern.
Maxime
Hello,
Quoted 42 lines · Maxime Ripard
Quoted 41 lines · Osama Abdelkader
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
Signed-off-by Osama Abdelkader <[email protected]>---
v3:
- Move the changelog after the---.v2:
- break long description lines.
- add Signed-off-by tagdrivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 8 +------- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 8 +------- drivers/gpu/drm/panel/panel-boe-td4320.c | 8 +------- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 4 +--- drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c | 8 +------- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 +------ 6 files changed, 6 insertions(+), 37 deletions(-)drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +1
-4@@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&boe->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;@@ -371,12 +371,6 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)static void boe_bf060y8m_aj0_remove (struct mipi_dsi_device *dsi) {struct boe_bf060y8m_aj0 *boe =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi);
Quoted 8 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) · line 375
Quoted 5 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +0
-3-if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&boe->panel); }
mipi_dsi_detachis now called afterdrm_panel_remove. Your commit log should mention it, and explain why it's not a concern.
Indeed. Or switch from drm_panel_add() to devm_drm_panel_add(), which would avoid the issue mentioned by Maxime and cleanup even more the code.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Quoted 57 lines · Luca Ceresoli
Hello,
Quoted 42 lines · Maxime Ripard
Quoted 41 lines · Osama Abdelkader
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
Signed-off-by Osama Abdelkader <[email protected]>---
v3:
- Move the changelog after the---.v2:
- break long description lines.
- add Signed-off-by tagdrivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 8 +------- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 8 +------- drivers/gpu/drm/panel/panel-boe-td4320.c | 8 +------- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 4 +--- drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c | 8 +------- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 +------ 6 files changed, 6 insertions(+), 37 deletions(-)drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +1
-4@@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&boe->panel); - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;@@ -371,12 +371,6 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)static void boe_bf060y8m_aj0_remove (struct mipi_dsi_device *dsi) {struct boe_bf060y8m_aj0 *boe =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi);Quoted 8 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) · line 375
Quoted 5 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +0
-3-if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&boe->panel); }
mipi_dsi_detachis now called afterdrm_panel_remove. Your commit log should mention it, and explain why it's not a concern.Indeed. Or switch from
drm_panel_add()todevm_drm_panel_add(), which would avoid the issue mentioned by Maxime and cleanup even more the code.
Quoted 6 lines
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Thanks for the reviews, I updated that in v4.
Best regards,
Osama
Quoted 4 lines · Osama Abdelkader
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
Signed-off-by Osama Abdelkader <[email protected]>
Please, next time use proper tools to send your series ina single thread with a cover letter. This v3 is made of 6 e-mails in 6 separate threads, which is very annoying to handle.
Quoted 22 lines
---
v3:
- Move the changelog after the---.v2:
- break long description lines.
- add Signed-off-by tagdrivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c | 8 +------- drivers/gpu/drm/panel/panel-boe-himax8279d.c | 8 +------- drivers/gpu/drm/panel/panel-boe-td4320.c | 8 +------- drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 4 +--- drivers/gpu/drm/panel/panel-boe-tv101wum-ll2.c | 8 +------- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 +------ 6 files changed, 6 insertions(+), 37 deletions(-)drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +0
-0
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) · line 360
Quoted 2 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +0
-0@@ -359,7 +359,7 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)drm_panel_add (&boe->panel);
Why not converting drm_panel_add() to the devm variant too? Without it...
Quoted 8 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +1
-1- ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (&dsi->dev, dsi);if (ret <0 ) {dev_err (dev,"Failed to attach to DSI host: %d\n" , ret);return ret;@@ -371,12 +371,6 @@ static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi)static void boe_bf060y8m_aj0_remove (struct mipi_dsi_device *dsi)
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c static int boe_bf060y8m_aj0_probe(struct mipi_dsi_device *dsi) · line 375
Quoted 10 lines
drivers/gpu/drm/panel/panel-boe-bf060y8m-aj0.c +0
-6{struct boe_bf060y8m_aj0 *boe =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =mipi_dsi_detach (dsi); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret); -drm_panel_remove (&boe->panel); }
...the remove sequence will be incorrect: removing the panel first (open coded) and detaching the DSI device afterwards (devm, done after .remove returns).
Same for the other files.
Note that patch 2 is correct in this respect.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Quoted 9 lines · Luca Ceresoli
Quoted 4 lines · Osama Abdelkader
Use the managed MIPI DSI attach helper in BOE panel drivers and drop the corresponding manual detach calls from remove paths.
Signed-off-by Osama Abdelkader <[email protected]>Please, next time use proper tools to send your series ina single thread with a cover letter. This v3 is made of 6 e-mails in 6 separate threads, which is very annoying to handle.
Ah, this comment was about v4. v3 is correctly threaded. Sorry about the mess.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com