Skip to content

Commit a50be87

Browse files
konradybciosuperna9999
authored andcommitted
drm/panel: novatek-nt35950: Only unregister DSI1 if it exists
Commit 5dd45b6 ("drm/panel: novatek-nt35950: Improve error handling") introduced logic to unregister DSI1 on any sort of probe failure, as that's not done automatically by kernel APIs. It did not however account for cases where only one DSI host is used. Fix that. Fixes: 5dd45b6 ("drm/panel: novatek-nt35950: Improve error handling") Reported-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Konrad Dybcio <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ab4f869 commit a50be87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/panel/panel-novatek-nt35950.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
586586

587587
ret = drm_panel_of_backlight(&nt->panel);
588588
if (ret) {
589-
mipi_dsi_device_unregister(nt->dsi[1]);
589+
if (num_dsis == 2)
590+
mipi_dsi_device_unregister(nt->dsi[1]);
590591

591592
return dev_err_probe(dev, ret, "Failed to get backlight\n");
592593
}
@@ -606,7 +607,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi)
606607
ret = mipi_dsi_attach(nt->dsi[i]);
607608
if (ret < 0) {
608609
/* If we fail to attach to either host, we're done */
609-
mipi_dsi_device_unregister(nt->dsi[1]);
610+
if (num_dsis == 2)
611+
mipi_dsi_device_unregister(nt->dsi[1]);
610612

611613
return dev_err_probe(dev, ret,
612614
"Cannot attach to DSI%d host.\n", i);

0 commit comments

Comments
 (0)