提交 d92e6009 编写于 作者: T Thierry Reding

drm/tegra: sor: Root debugfs files at the connector

Rather create new files within the top-level DRM device's debugfs node,
add the SOR specific files to the connector's debugfs node. This avoids
the need to come up with subdirectory names and is also more intuitive.
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 1d60047d
...@@ -184,7 +184,6 @@ struct tegra_sor { ...@@ -184,7 +184,6 @@ struct tegra_sor {
struct drm_info_list *debugfs_files; struct drm_info_list *debugfs_files;
struct drm_minor *minor; struct drm_minor *minor;
struct dentry *debugfs;
const struct tegra_sor_ops *ops; const struct tegra_sor_ops *ops;
...@@ -1260,14 +1259,10 @@ static const struct drm_info_list debugfs_files[] = { ...@@ -1260,14 +1259,10 @@ static const struct drm_info_list debugfs_files[] = {
static int tegra_sor_debugfs_init(struct tegra_sor *sor, static int tegra_sor_debugfs_init(struct tegra_sor *sor,
struct drm_minor *minor) struct drm_minor *minor)
{ {
const char *name = sor->soc->supports_dp ? "sor1" : "sor"; struct dentry *root = sor->output.connector.debugfs_entry;
unsigned int i; unsigned int i;
int err; int err;
sor->debugfs = debugfs_create_dir(name, minor->debugfs_root);
if (!sor->debugfs)
return -ENOMEM;
sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
GFP_KERNEL); GFP_KERNEL);
if (!sor->debugfs_files) { if (!sor->debugfs_files) {
...@@ -1280,7 +1275,7 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor, ...@@ -1280,7 +1275,7 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor,
err = drm_debugfs_create_files(sor->debugfs_files, err = drm_debugfs_create_files(sor->debugfs_files,
ARRAY_SIZE(debugfs_files), ARRAY_SIZE(debugfs_files),
sor->debugfs, minor); root, minor);
if (err < 0) if (err < 0)
goto free; goto free;
...@@ -1292,13 +1287,14 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor, ...@@ -1292,13 +1287,14 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor,
kfree(sor->debugfs_files); kfree(sor->debugfs_files);
sor->debugfs_files = NULL; sor->debugfs_files = NULL;
remove: remove:
debugfs_remove_recursive(sor->debugfs); debugfs_remove_recursive(root);
sor->debugfs = NULL;
return err; return err;
} }
static void tegra_sor_debugfs_exit(struct tegra_sor *sor) static void tegra_sor_debugfs_exit(struct tegra_sor *sor)
{ {
struct dentry *root = sor->output.connector.debugfs_entry;
drm_debugfs_remove_files(sor->debugfs_files, ARRAY_SIZE(debugfs_files), drm_debugfs_remove_files(sor->debugfs_files, ARRAY_SIZE(debugfs_files),
sor->minor); sor->minor);
sor->minor = NULL; sor->minor = NULL;
...@@ -1306,8 +1302,7 @@ static void tegra_sor_debugfs_exit(struct tegra_sor *sor) ...@@ -1306,8 +1302,7 @@ static void tegra_sor_debugfs_exit(struct tegra_sor *sor)
kfree(sor->debugfs_files); kfree(sor->debugfs_files);
sor->debugfs_files = NULL; sor->debugfs_files = NULL;
debugfs_remove_recursive(sor->debugfs); debugfs_remove_recursive(root);
sor->debugfs = NULL;
} }
static void tegra_sor_connector_reset(struct drm_connector *connector) static void tegra_sor_connector_reset(struct drm_connector *connector)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册