Skip to content

Commit bef236a

Browse files
committed
drm/bridge: ti-sn65dsi86: Move all the chip-related init to the start
This is just code motion of the probe routine to move all the things that are for the "whole chip" (instead of the GPIO parts or the MIPI-to-eDP parts) together at the start of probe. This is in preparation for breaking the driver into sub-drivers. Since we're using devm for all of the "whole chip" stuff this is actually quite easy now. Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Acked-by: Linus Walleij <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.8.Ide8ba40feb2e43bc98a11edbb08d696d62dcd83e@changeid
1 parent f94eb8a commit bef236a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/gpu/drm/bridge/ti-sn65dsi86.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,21 +1255,13 @@ static int ti_sn65dsi86_probe(struct i2c_client *client,
12551255
return PTR_ERR(pdata->regmap);
12561256
}
12571257

1258-
ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &pdata->panel, NULL);
1259-
if (ret) {
1260-
DRM_ERROR("could not find any panel node\n");
1261-
return ret;
1262-
}
1263-
12641258
pdata->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
12651259
if (IS_ERR(pdata->enable_gpio)) {
12661260
DRM_ERROR("failed to get enable gpio from DT\n");
12671261
ret = PTR_ERR(pdata->enable_gpio);
12681262
return ret;
12691263
}
12701264

1271-
ti_sn_bridge_parse_lanes(pdata, dev->of_node);
1272-
12731265
ret = ti_sn65dsi86_parse_regulators(pdata);
12741266
if (ret) {
12751267
DRM_ERROR("failed to parse regulators\n");
@@ -1280,12 +1272,22 @@ static int ti_sn65dsi86_probe(struct i2c_client *client,
12801272
if (IS_ERR(pdata->refclk))
12811273
return PTR_ERR(pdata->refclk);
12821274

1283-
ret = ti_sn_bridge_parse_dsi_host(pdata);
1275+
pm_runtime_enable(dev);
1276+
ret = devm_add_action_or_reset(dev, ti_sn65dsi86_runtime_disable, dev);
12841277
if (ret)
12851278
return ret;
12861279

1287-
pm_runtime_enable(dev);
1288-
ret = devm_add_action_or_reset(dev, ti_sn65dsi86_runtime_disable, dev);
1280+
ti_sn65dsi86_debugfs_init(pdata);
1281+
1282+
ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &pdata->panel, NULL);
1283+
if (ret) {
1284+
DRM_ERROR("could not find any panel node\n");
1285+
return ret;
1286+
}
1287+
1288+
ti_sn_bridge_parse_lanes(pdata, dev->of_node);
1289+
1290+
ret = ti_sn_bridge_parse_dsi_host(pdata);
12891291
if (ret)
12901292
return ret;
12911293

@@ -1303,8 +1305,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client,
13031305

13041306
drm_bridge_add(&pdata->bridge);
13051307

1306-
ti_sn65dsi86_debugfs_init(pdata);
1307-
13081308
return 0;
13091309
}
13101310

0 commit comments

Comments
 (0)