[PATCH v2 2/2] drm: panel: add Khadas TS050 panel driver
Sam Ravnborg
sam at ravnborg.org
Sat Dec 5 19:15:02 UTC 2020
Hi Neil,
> +
> +static int khadas_ts050_panel_probe(struct mipi_dsi_device *dsi)
> +{
> + struct khadas_ts050_panel *khadas_ts050;
> + int err;
> +
> + dsi->lanes = 4;
> + dsi->format = MIPI_DSI_FMT_RGB888;
> + dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> + MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET;
> +
> + khadas_ts050 = devm_kzalloc(&dsi->dev, sizeof(*khadas_ts050),
> + GFP_KERNEL);
> + if (!khadas_ts050)
> + return -ENOMEM;
> +
> + mipi_dsi_set_drvdata(dsi, khadas_ts050);
> + khadas_ts050->link = dsi;
> +
> + err = khadas_ts050_panel_add(khadas_ts050);
> + if (err < 0)
> + return err;
> +
> + return mipi_dsi_attach(dsi);
> +}
If mipi_dsi_attach() failes then da a drm_panel_remove() like this:
ret = mipi_dsi_attach(dsi);
if (ret)
drm_panel_remove(&khadas_ts050->base);
return ret;
This is again something several panels gets wrong.
With this fixed:
Reviewed-by: Sam Ravnborg <sam at ravnborg.org>
I assume you will fix it while applying.
Sam
More information about the dri-devel
mailing list