Skip to content

Commit 1d1f7b1

Browse files
Wolfram Sangdianders
authored andcommitted
drm/bridge: ti-sn65dsi86: make use of debugfs_init callback
Do not create a custom directory in debugfs-root, but use the debugfs_init callback to create a custom directory at the given place for the bridge. The new directory layout looks like this on a Renesas GrayHawk-Single with a R-Car V4M SoC: /sys/kernel/debug/dri/feb00000.display/DP-1/1-002c Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Signed-off-by: Douglas Anderson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 909bda2 commit 1d1f7b1

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

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

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -440,36 +440,8 @@ static int status_show(struct seq_file *s, void *data)
440440

441441
return 0;
442442
}
443-
444443
DEFINE_SHOW_ATTRIBUTE(status);
445444

446-
static void ti_sn65dsi86_debugfs_remove(void *data)
447-
{
448-
debugfs_remove_recursive(data);
449-
}
450-
451-
static void ti_sn65dsi86_debugfs_init(struct ti_sn65dsi86 *pdata)
452-
{
453-
struct device *dev = pdata->dev;
454-
struct dentry *debugfs;
455-
int ret;
456-
457-
debugfs = debugfs_create_dir(dev_name(dev), NULL);
458-
459-
/*
460-
* We might get an error back if debugfs wasn't enabled in the kernel
461-
* so let's just silently return upon failure.
462-
*/
463-
if (IS_ERR_OR_NULL(debugfs))
464-
return;
465-
466-
ret = devm_add_action_or_reset(dev, ti_sn65dsi86_debugfs_remove, debugfs);
467-
if (ret)
468-
return;
469-
470-
debugfs_create_file("status", 0600, debugfs, pdata, &status_fops);
471-
}
472-
473445
/* -----------------------------------------------------------------------------
474446
* Auxiliary Devices (*not* AUX)
475447
*/
@@ -1238,6 +1210,15 @@ static const struct drm_edid *ti_sn_bridge_edid_read(struct drm_bridge *bridge,
12381210
return drm_edid_read_ddc(connector, &pdata->aux.ddc);
12391211
}
12401212

1213+
static void ti_sn65dsi86_debugfs_init(struct drm_bridge *bridge, struct dentry *root)
1214+
{
1215+
struct ti_sn65dsi86 *pdata = bridge_to_ti_sn65dsi86(bridge);
1216+
struct dentry *debugfs;
1217+
1218+
debugfs = debugfs_create_dir(dev_name(pdata->dev), root);
1219+
debugfs_create_file("status", 0600, debugfs, pdata, &status_fops);
1220+
}
1221+
12411222
static const struct drm_bridge_funcs ti_sn_bridge_funcs = {
12421223
.attach = ti_sn_bridge_attach,
12431224
.detach = ti_sn_bridge_detach,
@@ -1251,6 +1232,7 @@ static const struct drm_bridge_funcs ti_sn_bridge_funcs = {
12511232
.atomic_reset = drm_atomic_helper_bridge_reset,
12521233
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
12531234
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
1235+
.debugfs_init = ti_sn65dsi86_debugfs_init,
12541236
};
12551237

12561238
static void ti_sn_bridge_parse_lanes(struct ti_sn65dsi86 *pdata,
@@ -1959,8 +1941,6 @@ static int ti_sn65dsi86_probe(struct i2c_client *client)
19591941
if (ret)
19601942
return ret;
19611943

1962-
ti_sn65dsi86_debugfs_init(pdata);
1963-
19641944
/*
19651945
* Break ourselves up into a collection of aux devices. The only real
19661946
* motiviation here is to solve the chicken-and-egg problem of probe

0 commit comments

Comments
 (0)