Skip to content

Commit 38992c5

Browse files
Jyri Sarhathierryreding
authored andcommitted
drm/panel: Remove drm_panel_detach() calls from all panel drivers
Remove all drm_panel_detach() calls from all panel drivers and update the kerneldoc for drm_panel_detach(). Setting the connector and drm to NULL when the DRM panel device is going away hardly serves any purpose. Usually the whole memory structure is freed right after the remove call. However, calling the detach function from the master DRM device, and setting the connector pointer to NULL, has the logic of marking the panel again as available for another DRM master to attach. The usual situation would be the same DRM master device binding again. Signed-off-by: Jyri Sarha <jsarha@ti.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/464b8d330d6b4c94cfb5aad2ca9ea7eb2c52d934.1524727888.git.jsarha@ti.com
1 parent 6553b12 commit 38992c5

10 files changed

+6
-9
lines changed

drivers/gpu/drm/drm_panel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ EXPORT_SYMBOL(drm_panel_remove);
9494
*
9595
* An error is returned if the panel is already attached to another connector.
9696
*
97+
* When unloading, the driver should detach from the panel by calling
98+
* drm_panel_detach().
99+
*
97100
* Return: 0 on success or a negative error code on failure.
98101
*/
99102
int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector)
@@ -115,6 +118,9 @@ EXPORT_SYMBOL(drm_panel_attach);
115118
* Detaches a panel from the connector it is attached to. If a panel is not
116119
* attached to any connector this is effectively a no-op.
117120
*
121+
* This function should not be called by the panel device itself. It
122+
* is only for the drm device that called drm_panel_attach().
123+
*
118124
* Return: 0 on success or a negative error code on failure.
119125
*/
120126
int drm_panel_detach(struct drm_panel *panel)

drivers/gpu/drm/panel/panel-innolux-p079zca.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ static int innolux_panel_remove(struct mipi_dsi_device *dsi)
292292
DRM_DEV_ERROR(&dsi->dev, "failed to detach from DSI host: %d\n",
293293
err);
294294

295-
drm_panel_detach(&innolux->base);
296295
innolux_panel_del(innolux);
297296

298297
return 0;

drivers/gpu/drm/panel/panel-jdi-lt070me05000.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ static int jdi_panel_remove(struct mipi_dsi_device *dsi)
500500
dev_err(&dsi->dev, "failed to detach from DSI host: %d\n",
501501
ret);
502502

503-
drm_panel_detach(&jdi->base);
504503
jdi_panel_del(jdi);
505504

506505
return 0;

drivers/gpu/drm/panel/panel-lvds.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ static int panel_lvds_remove(struct platform_device *pdev)
282282
{
283283
struct panel_lvds *lvds = dev_get_drvdata(&pdev->dev);
284284

285-
drm_panel_detach(&lvds->panel);
286285
drm_panel_remove(&lvds->panel);
287286

288287
panel_lvds_disable(&lvds->panel);

drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ static int wuxga_nt_panel_remove(struct mipi_dsi_device *dsi)
299299
if (ret < 0)
300300
dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
301301

302-
drm_panel_detach(&wuxga_nt->base);
303302
wuxga_nt_panel_del(wuxga_nt);
304303

305304
return 0;

drivers/gpu/drm/panel/panel-seiko-43wvf1g.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ static int seiko_panel_remove(struct platform_device *pdev)
292292
{
293293
struct seiko_panel *panel = dev_get_drvdata(&pdev->dev);
294294

295-
drm_panel_detach(&panel->base);
296295
drm_panel_remove(&panel->base);
297296

298297
seiko_panel_disable(&panel->base);

drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ static int sharp_panel_remove(struct mipi_dsi_device *dsi)
418418
if (err < 0)
419419
dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
420420

421-
drm_panel_detach(&sharp->base);
422421
sharp_panel_del(sharp);
423422

424423
return 0;

drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ static int sharp_nt_panel_remove(struct mipi_dsi_device *dsi)
327327
if (ret < 0)
328328
dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
329329

330-
drm_panel_detach(&sharp_nt->base);
331330
sharp_nt_panel_del(sharp_nt);
332331

333332
return 0;

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ static int panel_simple_remove(struct device *dev)
364364
{
365365
struct panel_simple *panel = dev_get_drvdata(dev);
366366

367-
drm_panel_detach(&panel->base);
368367
drm_panel_remove(&panel->base);
369368

370369
panel_simple_disable(&panel->base);

drivers/gpu/drm/panel/panel-sitronix-st7789v.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ static int st7789v_remove(struct spi_device *spi)
419419
{
420420
struct st7789v *ctx = spi_get_drvdata(spi);
421421

422-
drm_panel_detach(&ctx->panel);
423422
drm_panel_remove(&ctx->panel);
424423

425424
if (ctx->backlight)

0 commit comments

Comments
 (0)