drm/sti: fix compositor debugfs creation
authorVincent Abriou <vincent.abriou@st.com>
Thu, 15 Sep 2016 15:11:07 +0000 (17:11 +0200)
committerVincent Abriou <vincent.abriou@st.com>
Tue, 20 Sep 2016 09:32:07 +0000 (11:32 +0200)
Fix typo and issue while creating the vid and mixer debugfs entries.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
drivers/gpu/drm/sti/sti_compositor.c
drivers/gpu/drm/sti/sti_compositor.h
drivers/gpu/drm/sti/sti_crtc.c

index ac160b01478fda6e8f6086cb3e44fbf6e14da082..a6f391b71d7a411c5b5b0079a02fa03691afa016 100644 (file)
@@ -55,22 +55,18 @@ static const struct sti_compositor_data stih416_compositor_data = {
        },
 };
 
-int sti_compositor_debufs_init(struct sti_compositor *compo,
-                              struct drm_minor *minor)
+int sti_compositor_debugfs_init(struct sti_compositor *compo,
+                               struct drm_minor *minor)
 {
-       int ret = 0, i;
+       unsigned int i;
 
-       for (i = 0; compo->vid[i]; i++) {
-               ret = vid_debugfs_init(compo->vid[i], minor);
-               if (ret)
-                       return ret;
-       }
+       for (i = 0; i < STI_MAX_VID; i++)
+               if (compo->vid[i])
+                       vid_debugfs_init(compo->vid[i], minor);
 
-       for (i = 0; compo->mixer[i]; i++) {
-               ret = sti_mixer_debugfs_init(compo->mixer[i], minor);
-               if (ret)
-                       return ret;
-       }
+       for (i = 0; i < STI_MAX_MIXER; i++)
+               if (compo->mixer[i])
+                       sti_mixer_debugfs_init(compo->mixer[i], minor);
 
        return 0;
 }
index c9e7e3bf183e5459994836a5066dcfb8ac1b607e..2952a2d25a52b6c6fe3efdfc3d4036f66454540d 100644 (file)
@@ -79,7 +79,7 @@ struct sti_compositor {
        struct notifier_block vtg_vblank_nb[STI_MAX_MIXER];
 };
 
-int sti_compositor_debufs_init(struct sti_compositor *compo,
-                              struct drm_minor *minor);
+int sti_compositor_debugfs_init(struct sti_compositor *compo,
+                               struct drm_minor *minor);
 
 #endif
index bc1b186f129cc26a1c349ca3a3950a1e9e5d3299..e992bed98dcba8c7ee441f56709ac5c791fa8fb9 100644 (file)
@@ -338,7 +338,7 @@ static int sti_crtc_late_register(struct drm_crtc *crtc)
        struct sti_compositor *compo = dev_get_drvdata(mixer->dev);
 
        if (drm_crtc_index(crtc) == 0)
-               return sti_compositor_debufs_init(compo, crtc->dev->primary);
+               return sti_compositor_debugfs_init(compo, crtc->dev->primary);
 
        return 0;
 }