Skip to content

Commit f94eb8a

Browse files
committed
drm/bridge: ti-sn65dsi86: Cleanup managing of drvdata
Let's: - Set the drvdata as soon as it's allocated. This just sets up a pointer so there's no downside here. - Remove the useless call to i2c_set_clientdata() which is literally the same thing as dev_set_drvdata(). No functional changes intended. 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.7.If5d4d4e22e97bebcd493b76765c1759527705620@changeid
1 parent 3636fc2 commit f94eb8a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,8 @@ static int ti_sn65dsi86_probe(struct i2c_client *client,
12451245
pdata = devm_kzalloc(dev, sizeof(struct ti_sn65dsi86), GFP_KERNEL);
12461246
if (!pdata)
12471247
return -ENOMEM;
1248+
dev_set_drvdata(dev, pdata);
1249+
pdata->dev = dev;
12481250

12491251
pdata->regmap = devm_regmap_init_i2c(client,
12501252
&ti_sn65dsi86_regmap_config);
@@ -1253,16 +1255,12 @@ static int ti_sn65dsi86_probe(struct i2c_client *client,
12531255
return PTR_ERR(pdata->regmap);
12541256
}
12551257

1256-
pdata->dev = dev;
1257-
12581258
ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &pdata->panel, NULL);
12591259
if (ret) {
12601260
DRM_ERROR("could not find any panel node\n");
12611261
return ret;
12621262
}
12631263

1264-
dev_set_drvdata(dev, pdata);
1265-
12661264
pdata->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
12671265
if (IS_ERR(pdata->enable_gpio)) {
12681266
DRM_ERROR("failed to get enable gpio from DT\n");
@@ -1295,8 +1293,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client,
12951293
if (ret)
12961294
return ret;
12971295

1298-
i2c_set_clientdata(client, pdata);
1299-
13001296
pdata->aux.name = "ti-sn65dsi86-aux";
13011297
pdata->aux.dev = dev;
13021298
pdata->aux.transfer = ti_sn_aux_transfer;

0 commit comments

Comments
 (0)