diff mbox

[v2] drm/sti: fix compositor debugfs creation

Message ID 1473952347-12017-1-git-send-email-vincent.abriou@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vincent Abriou Sept. 15, 2016, 3:12 p.m. UTC
Fix typo and issue while creating the vid and mixer debugfs entries.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
---
 drivers/gpu/drm/sti/sti_compositor.c | 22 +++++++++-------------
 drivers/gpu/drm/sti/sti_compositor.h |  4 ++--
 drivers/gpu/drm/sti/sti_crtc.c       |  2 +-
 3 files changed, 12 insertions(+), 16 deletions(-)

Comments

Benjamin Gaignard Sept. 15, 2016, 3:16 p.m. UTC | #1
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

2016-09-15 17:12 GMT+02:00 Vincent Abriou <vincent.abriou@st.com>:
> Fix typo and issue while creating the vid and mixer debugfs entries.
>
> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
> ---
>  drivers/gpu/drm/sti/sti_compositor.c | 22 +++++++++-------------
>  drivers/gpu/drm/sti/sti_compositor.h |  4 ++--
>  drivers/gpu/drm/sti/sti_crtc.c       |  2 +-
>  3 files changed, 12 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c
> index f0c6f0a..89471b3 100644
> --- a/drivers/gpu/drm/sti/sti_compositor.c
> +++ b/drivers/gpu/drm/sti/sti_compositor.c
> @@ -55,22 +55,18 @@ 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;
>  }
> diff --git a/drivers/gpu/drm/sti/sti_compositor.h b/drivers/gpu/drm/sti/sti_compositor.h
> index c9e7e3b..2952a2d 100644
> --- a/drivers/gpu/drm/sti/sti_compositor.h
> +++ b/drivers/gpu/drm/sti/sti_compositor.h
> @@ -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
> diff --git a/drivers/gpu/drm/sti/sti_crtc.c b/drivers/gpu/drm/sti/sti_crtc.c
> index bc1b186..e992bed 100644
> --- a/drivers/gpu/drm/sti/sti_crtc.c
> +++ b/drivers/gpu/drm/sti/sti_crtc.c
> @@ -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;
>  }
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c
index f0c6f0a..89471b3 100644
--- a/drivers/gpu/drm/sti/sti_compositor.c
+++ b/drivers/gpu/drm/sti/sti_compositor.c
@@ -55,22 +55,18 @@  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;
 }
diff --git a/drivers/gpu/drm/sti/sti_compositor.h b/drivers/gpu/drm/sti/sti_compositor.h
index c9e7e3b..2952a2d 100644
--- a/drivers/gpu/drm/sti/sti_compositor.h
+++ b/drivers/gpu/drm/sti/sti_compositor.h
@@ -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
diff --git a/drivers/gpu/drm/sti/sti_crtc.c b/drivers/gpu/drm/sti/sti_crtc.c
index bc1b186..e992bed 100644
--- a/drivers/gpu/drm/sti/sti_crtc.c
+++ b/drivers/gpu/drm/sti/sti_crtc.c
@@ -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;
 }