]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: omap2: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Feb 2019 18:24:47 +0000 (19:24 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 8 Feb 2019 18:24:47 +0000 (19:24 +0100)
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/omap2/omapfb/dss/core.c
drivers/video/fbdev/omap2/omapfb/dss/dss.h

index b4bcf3a4a6475be6bd1da796c476bbbf2a47f915..7e6a3eb266d0c911f16503ac0d7110a600c11a17 100644 (file)
@@ -110,19 +110,12 @@ DEFINE_SHOW_ATTRIBUTE(dss);
 
 static struct dentry *dss_debugfs_dir;
 
-static int dss_initialize_debugfs(void)
+static void dss_initialize_debugfs(void)
 {
        dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
-       if (IS_ERR(dss_debugfs_dir)) {
-               int err = PTR_ERR(dss_debugfs_dir);
-               dss_debugfs_dir = NULL;
-               return err;
-       }
 
        debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
                        &dss_debug_dump_clocks, &dss_fops);
-
-       return 0;
 }
 
 static void dss_uninitialize_debugfs(void)
@@ -130,24 +123,18 @@ static void dss_uninitialize_debugfs(void)
        debugfs_remove_recursive(dss_debugfs_dir);
 }
 
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
+void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
 {
-       struct dentry *d;
-
-       d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir,
-                       write, &dss_fops);
-
-       return PTR_ERR_OR_ZERO(d);
+       debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, write, &dss_fops);
 }
 #else /* CONFIG_FB_OMAP2_DSS_DEBUGFS */
-static inline int dss_initialize_debugfs(void)
+static inline void dss_initialize_debugfs(void)
 {
-       return 0;
 }
 static inline void dss_uninitialize_debugfs(void)
 {
 }
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
+void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
 {
        return 0;
 }
@@ -188,9 +175,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 
        dss_features_init(omapdss_get_version());
 
-       r = dss_initialize_debugfs();
-       if (r)
-               goto err_debugfs;
+       dss_initialize_debugfs();
 
        if (def_disp_name)
                core.default_display_name = def_disp_name;
@@ -198,10 +183,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
        register_pm_notifier(&omap_dss_pm_notif_block);
 
        return 0;
-
-err_debugfs:
-
-       return r;
 }
 
 static int omap_dss_remove(struct platform_device *pdev)
index a3cc0ca8f9d240d3b5646e3eda4fc4193033fe81..b1a354494144711e95882f1b05c97a583a000911 100644 (file)
@@ -214,7 +214,7 @@ struct platform_device *dss_get_core_pdev(void);
 int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask);
 void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask);
 int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *));
+void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *));
 
 /* display */
 int dss_suspend_all_devices(void);