[PATCH] drm/panel: sharp-lq101r1sx01: Fixed reversed "if" in remove

From: Douglas Anderson
Date: Mon Jul 08 2024 - 13:53:33 EST


Commit d7d473d8464e ("drm/panel: sharp-lq101r1sx01: Don't call disable
at shutdown/remove") had a subtle bug. We should be calling
sharp_panel_del() when the "sharp" variable is non-NULL, not when it's
NULL. Fix.

Fixes: d7d473d8464e ("drm/panel: sharp-lq101r1sx01: Don't call disable at shutdown/remove")
Cc: Thierry Reding <treding@xxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Closes: https://lore.kernel.org/r/202406261525.SkhtM3ZV-lkp@xxxxxxxxx/
Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
---

drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
index edc9425bb143..a0d76d588da1 100644
--- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
+++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
@@ -362,7 +362,7 @@ static void sharp_panel_remove(struct mipi_dsi_device *dsi)
dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);

/* only detach from host for the DSI-LINK2 interface */
- if (!sharp)
+ if (sharp)
sharp_panel_del(sharp);
}

--
2.45.2.803.g4e1b14247a-goog