mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 10:00:03 -04:00
drm/bridge: tc358762: use devm for bridge registration and DSI attach
Replace manual drm_bridge_remove()/mipi_dsi_detach() in remove with devm_drm_bridge_add() and devm_mipi_dsi_attach() in probe. Also check the return value from bridge registration. Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://patch.msgid.link/20260521215228.188615-1-osama.abdelkader@gmail.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
committed by
Luca Ceresoli
parent
4085da1e6a
commit
19ff4e174f
@@ -292,25 +292,17 @@ static int tc358762_probe(struct mipi_dsi_device *dsi)
|
||||
ctx->bridge.of_node = dev->of_node;
|
||||
ctx->bridge.pre_enable_prev_first = true;
|
||||
|
||||
drm_bridge_add(&ctx->bridge);
|
||||
ret = devm_drm_bridge_add(dev, &ctx->bridge);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = mipi_dsi_attach(dsi);
|
||||
if (ret < 0) {
|
||||
drm_bridge_remove(&ctx->bridge);
|
||||
ret = devm_mipi_dsi_attach(dev, dsi);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "failed to attach dsi\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void tc358762_remove(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
struct tc358762 *ctx = mipi_dsi_get_drvdata(dsi);
|
||||
|
||||
mipi_dsi_detach(dsi);
|
||||
drm_bridge_remove(&ctx->bridge);
|
||||
}
|
||||
|
||||
static const struct of_device_id tc358762_of_match[] = {
|
||||
{ .compatible = "toshiba,tc358762" },
|
||||
{ }
|
||||
@@ -319,7 +311,6 @@ MODULE_DEVICE_TABLE(of, tc358762_of_match);
|
||||
|
||||
static struct mipi_dsi_driver tc358762_driver = {
|
||||
.probe = tc358762_probe,
|
||||
.remove = tc358762_remove,
|
||||
.driver = {
|
||||
.name = "tc358762",
|
||||
.of_match_table = tc358762_of_match,
|
||||
|
||||
Reference in New Issue
Block a user