Having debugfs files for the InfoFrames that are not supported by the
driver is confusing, stop registering those in the debugfs.

Signed-off-by: Dmitry Baryshkov <[email protected]>
---
 drivers/gpu/drm/drm_debugfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 365cf337529f..ae1c6126c2c5 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -672,6 +672,10 @@ static int create_hdmi_audio_infoframe_file(struct 
drm_connector *connector,
 {
        struct dentry *file;
 
+       if (!connector->hdmi.funcs ||
+           !connector->hdmi.funcs->audio.write_infoframe)
+               return 0;
+
        file = debugfs_create_file("audio", 0400, parent, connector, 
&audio_infoframe_fops);
        if (IS_ERR(file))
                return PTR_ERR(file);
@@ -726,6 +730,9 @@ static int create_hdmi_## _f ## _infoframe_file(struct 
drm_connector *connector,
 { \
        struct dentry *file; \
        \
+       if (!connector->hdmi.funcs || \
+           !connector->hdmi.funcs->_f.write_infoframe) \
+               return 0; \
        file = debugfs_create_file(#_f, 0400, parent, connector, &_f ## 
_infoframe_fops); \
        if (IS_ERR(file)) \
                return PTR_ERR(file); \

-- 
2.47.3

Reply via email to