Unverified Commit 49e61bee authored by Maxime Ripard's avatar Maxime Ripard
Browse files

drm/bridge: anx7625: Register and attach our DSI device at probe



In order to avoid any probe ordering issue, the best practice is to move
the secondary MIPI-DSI device registration and attachment to the
MIPI-DSI host at probe time. Let's do this.

Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-5-maxime@cerno.tech
parent 25a390a9
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -1367,12 +1367,6 @@ static int anx7625_bridge_attach(struct drm_bridge *bridge,
		return -ENODEV;
	}

	err = anx7625_attach_dsi(ctx);
	if (err) {
		DRM_DEV_ERROR(dev, "Fail to attach to dsi : %d\n", err);
		return err;
	}

	if (ctx->pdata.panel_bridge) {
		err = drm_bridge_attach(bridge->encoder,
					ctx->pdata.panel_bridge,
@@ -1845,10 +1839,24 @@ static int anx7625_i2c_probe(struct i2c_client *client,
	platform->bridge.type = DRM_MODE_CONNECTOR_eDP;
	drm_bridge_add(&platform->bridge);

	ret = anx7625_attach_dsi(platform);
	if (ret) {
		DRM_DEV_ERROR(dev, "Fail to attach to dsi : %d\n", ret);
		goto unregister_bridge;
	}

	DRM_DEV_DEBUG_DRIVER(dev, "probe done\n");

	return 0;

unregister_bridge:
	drm_bridge_remove(&platform->bridge);

	if (!platform->pdata.low_power_mode)
		pm_runtime_put_sync_suspend(&client->dev);

	anx7625_unregister_i2c_dummy_clients(platform);

free_wq:
	if (platform->workqueue)
		destroy_workqueue(platform->workqueue);