Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: sharp-lq101r1sx01: Don't call disable at shutdown/remove

It's the responsibility of a correctly written DRM modeset driver to
call drm_atomic_helper_shutdown() at shutdown time and that should be
disabling / unpreparing the panel if needed. Panel drivers shouldn't
be calling these functions themselves.

A recent effort was made to fix as many DRM modeset drivers as
possible [1] [2] [3] and most drivers are fixed now.

A grep through mainline for compatible strings used by this driver
indicates that it is used by Tegra boards. The Tegra driver appears to
be correctly calling drm_atomic_helper_shutdown() so we can remove the
calls.

[1] https://lore.kernel.org/r/20230901234015.566018-1-dianders@chromium.org
[2] https://lore.kernel.org/r/20230901234202.566951-1-dianders@chromium.org
[3] https://lore.kernel.org/r/20230921192749.1542462-1-dianders@chromium.org

Cc: Thierry Reding <treding@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240604172305.v3.18.I6a87fce1ee027c96f71c7adf74248b865f50b336@changeid
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604172305.v3.18.I6a87fce1ee027c96f71c7adf74248b865f50b336@changeid

authored by

Douglas Anderson and committed by
Neil Armstrong
d7d473d8 316bb147

+2 -22
+2 -22
drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
··· 357 357 struct sharp_panel *sharp = mipi_dsi_get_drvdata(dsi); 358 358 int err; 359 359 360 - /* only detach from host for the DSI-LINK2 interface */ 361 - if (!sharp) { 362 - mipi_dsi_detach(dsi); 363 - return; 364 - } 365 - 366 - err = drm_panel_disable(&sharp->base); 367 - if (err < 0) 368 - dev_err(&dsi->dev, "failed to disable panel: %d\n", err); 369 - 370 360 err = mipi_dsi_detach(dsi); 371 361 if (err < 0) 372 362 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); 373 363 374 - sharp_panel_del(sharp); 375 - } 376 - 377 - static void sharp_panel_shutdown(struct mipi_dsi_device *dsi) 378 - { 379 - struct sharp_panel *sharp = mipi_dsi_get_drvdata(dsi); 380 - 381 - /* nothing to do for DSI-LINK2 */ 364 + /* only detach from host for the DSI-LINK2 interface */ 382 365 if (!sharp) 383 - return; 384 - 385 - drm_panel_disable(&sharp->base); 366 + sharp_panel_del(sharp); 386 367 } 387 368 388 369 static struct mipi_dsi_driver sharp_panel_driver = { ··· 373 392 }, 374 393 .probe = sharp_panel_probe, 375 394 .remove = sharp_panel_remove, 376 - .shutdown = sharp_panel_shutdown, 377 395 }; 378 396 module_mipi_dsi_driver(sharp_panel_driver); 379 397