]> Git Repo - linux.git/commitdiff
omapdrm: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <[email protected]>
Thu, 13 Jun 2019 11:57:49 +0000 (13:57 +0200)
committerTomi Valkeinen <[email protected]>
Fri, 23 Aug 2019 07:21:03 +0000 (10:21 +0300)
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.

Cc: Tomi Valkeinen <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Jyri Sarha <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: zhong jiang <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/omapdrm/dss/dss.c

index 5711b7a720e6e2484f45ae0beb0ad050945b5534..e226324adb697874631cd23f95cff68a3b7d0b39 100644 (file)
@@ -923,7 +923,6 @@ dss_debugfs_create_file(struct dss_device *dss, const char *name,
                        void *data)
 {
        struct dss_debugfs_entry *entry;
-       struct dentry *d;
 
        entry = kzalloc(sizeof(*entry), GFP_KERNEL);
        if (!entry)
@@ -931,15 +930,9 @@ dss_debugfs_create_file(struct dss_device *dss, const char *name,
 
        entry->show_fn = show_fn;
        entry->data = data;
+       entry->dentry = debugfs_create_file(name, 0444, dss->debugfs.root,
+                                           entry, &dss_debug_fops);
 
-       d = debugfs_create_file(name, 0444, dss->debugfs.root, entry,
-                               &dss_debug_fops);
-       if (IS_ERR(d)) {
-               kfree(entry);
-               return ERR_CAST(d);
-       }
-
-       entry->dentry = d;
        return entry;
 }
 
This page took 0.056005 seconds and 4 git commands to generate.