drm: panel: nt36523: use devm_mipi_dsi_* function to register and attach dsi
Switch to devm_mipi_dsi_* function, we don't need to detach and unregister dsi manually any more. Signed-off-by: Jianhua Lu <lujianhua000@gmail.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20240904142907.367786-1-lujianhua000@gmail.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240904142907.367786-1-lujianhua000@gmail.com
This commit is contained in:
committed by
Neil Armstrong
parent
d5acba46eb
commit
62f6bc14bb
@@ -1095,18 +1095,6 @@ static int nt36523_unprepare(struct drm_panel *panel)
|
||||
static void nt36523_remove(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
struct panel_info *pinfo = mipi_dsi_get_drvdata(dsi);
|
||||
int ret;
|
||||
|
||||
ret = mipi_dsi_detach(pinfo->dsi[0]);
|
||||
if (ret < 0)
|
||||
dev_err(&dsi->dev, "failed to detach from DSI0 host: %d\n", ret);
|
||||
|
||||
if (pinfo->desc->is_dual_dsi) {
|
||||
ret = mipi_dsi_detach(pinfo->dsi[1]);
|
||||
if (ret < 0)
|
||||
dev_err(&pinfo->dsi[1]->dev, "failed to detach from DSI1 host: %d\n", ret);
|
||||
mipi_dsi_device_unregister(pinfo->dsi[1]);
|
||||
}
|
||||
|
||||
drm_panel_remove(&pinfo->panel);
|
||||
}
|
||||
@@ -1251,7 +1239,7 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
|
||||
if (!dsi1_host)
|
||||
return dev_err_probe(dev, -EPROBE_DEFER, "cannot get secondary DSI host\n");
|
||||
|
||||
pinfo->dsi[1] = mipi_dsi_device_register_full(dsi1_host, info);
|
||||
pinfo->dsi[1] = devm_mipi_dsi_device_register_full(dev, dsi1_host, info);
|
||||
if (IS_ERR(pinfo->dsi[1])) {
|
||||
dev_err(dev, "cannot get secondary DSI device\n");
|
||||
return PTR_ERR(pinfo->dsi[1]);
|
||||
@@ -1288,7 +1276,7 @@ static int nt36523_probe(struct mipi_dsi_device *dsi)
|
||||
pinfo->dsi[i]->format = pinfo->desc->format;
|
||||
pinfo->dsi[i]->mode_flags = pinfo->desc->mode_flags;
|
||||
|
||||
ret = mipi_dsi_attach(pinfo->dsi[i]);
|
||||
ret = devm_mipi_dsi_attach(dev, pinfo->dsi[i]);
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "cannot attach to DSI%d host.\n", i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user