drm/tegra: remove checks for debugfs functions return value
authorWambui Karuga <wambui.karugax@gmail.com>
Tue, 10 Mar 2020 13:31:05 +0000 (16:31 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 18 Mar 2020 15:20:28 +0000 (16:20 +0100)
Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail) there is no need to check the
return value of drm_debugfs_create_files(). Therefore, remove the
return checks and error handling of the drm_debugfs_create_files()
function from various debugfs init functions in drm/tegra and have
them return 0 directly.

v2: remove conversion of tegra_debugfs_init() to void to avoid build
breakage.

References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.html
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-2-wambui.karugax@gmail.com
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/tegra/dsi.c
drivers/gpu/drm/tegra/hdmi.c
drivers/gpu/drm/tegra/sor.c

index 7c70fd3..e70d58b 100644 (file)
@@ -1496,7 +1496,6 @@ static int tegra_dc_late_register(struct drm_crtc *crtc)
        struct drm_minor *minor = crtc->dev->primary;
        struct dentry *root;
        struct tegra_dc *dc = to_tegra_dc(crtc);
-       int err;
 
 #ifdef CONFIG_DEBUG_FS
        root = crtc->debugfs_entry;
@@ -1512,17 +1511,9 @@ static int tegra_dc_late_register(struct drm_crtc *crtc)
        for (i = 0; i < count; i++)
                dc->debugfs_files[i].data = dc;
 
-       err = drm_debugfs_create_files(dc->debugfs_files, count, root, minor);
-       if (err < 0)
-               goto free;
+       drm_debugfs_create_files(dc->debugfs_files, count, root, minor);
 
        return 0;
-
-free:
-       kfree(dc->debugfs_files);
-       dc->debugfs_files = NULL;
-
-       return err;
 }
 
 static void tegra_dc_early_unregister(struct drm_crtc *crtc)
index bd26802..6ec224f 100644 (file)
@@ -841,9 +841,10 @@ static struct drm_info_list tegra_debugfs_list[] = {
 
 static int tegra_debugfs_init(struct drm_minor *minor)
 {
-       return drm_debugfs_create_files(tegra_debugfs_list,
-                                       ARRAY_SIZE(tegra_debugfs_list),
-                                       minor->debugfs_root, minor);
+       drm_debugfs_create_files(tegra_debugfs_list,
+                                ARRAY_SIZE(tegra_debugfs_list),
+                                minor->debugfs_root, minor);
+       return 0;
 }
 #endif
 
index 88b9d64..30626fc 100644 (file)
@@ -234,7 +234,6 @@ static int tegra_dsi_late_register(struct drm_connector *connector)
        struct drm_minor *minor = connector->dev->primary;
        struct dentry *root = connector->debugfs_entry;
        struct tegra_dsi *dsi = to_dsi(output);
-       int err;
 
        dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
                                     GFP_KERNEL);
@@ -244,17 +243,9 @@ static int tegra_dsi_late_register(struct drm_connector *connector)
        for (i = 0; i < count; i++)
                dsi->debugfs_files[i].data = dsi;
 
-       err = drm_debugfs_create_files(dsi->debugfs_files, count, root, minor);
-       if (err < 0)
-               goto free;
+       drm_debugfs_create_files(dsi->debugfs_files, count, root, minor);
 
        return 0;
-
-free:
-       kfree(dsi->debugfs_files);
-       dsi->debugfs_files = NULL;
-
-       return err;
 }
 
 static void tegra_dsi_early_unregister(struct drm_connector *connector)
index 6f11762..d7799d1 100644 (file)
@@ -1064,7 +1064,6 @@ static int tegra_hdmi_late_register(struct drm_connector *connector)
        struct drm_minor *minor = connector->dev->primary;
        struct dentry *root = connector->debugfs_entry;
        struct tegra_hdmi *hdmi = to_hdmi(output);
-       int err;
 
        hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
                                      GFP_KERNEL);
@@ -1074,17 +1073,9 @@ static int tegra_hdmi_late_register(struct drm_connector *connector)
        for (i = 0; i < count; i++)
                hdmi->debugfs_files[i].data = hdmi;
 
-       err = drm_debugfs_create_files(hdmi->debugfs_files, count, root, minor);
-       if (err < 0)
-               goto free;
+       drm_debugfs_create_files(hdmi->debugfs_files, count, root, minor);
 
        return 0;
-
-free:
-       kfree(hdmi->debugfs_files);
-       hdmi->debugfs_files = NULL;
-
-       return err;
 }
 
 static void tegra_hdmi_early_unregister(struct drm_connector *connector)
index 81226a4..47c1d13 100644 (file)
@@ -1687,7 +1687,6 @@ static int tegra_sor_late_register(struct drm_connector *connector)
        struct drm_minor *minor = connector->dev->primary;
        struct dentry *root = connector->debugfs_entry;
        struct tegra_sor *sor = to_sor(output);
-       int err;
 
        sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
                                     GFP_KERNEL);
@@ -1697,17 +1696,9 @@ static int tegra_sor_late_register(struct drm_connector *connector)
        for (i = 0; i < count; i++)
                sor->debugfs_files[i].data = sor;
 
-       err = drm_debugfs_create_files(sor->debugfs_files, count, root, minor);
-       if (err < 0)
-               goto free;
+       drm_debugfs_create_files(sor->debugfs_files, count, root, minor);
 
        return 0;
-
-free:
-       kfree(sor->debugfs_files);
-       sor->debugfs_files = NULL;
-
-       return err;
 }
 
 static void tegra_sor_early_unregister(struct drm_connector *connector)