malidp: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Jun 2019 13:28:29 +0000 (15:28 +0200)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Wed, 19 Jun 2019 16:03:23 +0000 (17:03 +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.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Brian Starkey <brian.starkey@arm.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/arm/malidp_drv.c

index af1992f06a1dd0a56a482b3e43e57eea1ccf536e..f25ec43822772aa3446b7b725002e44486e96a24 100644 (file)
@@ -549,19 +549,12 @@ static const struct file_operations malidp_debugfs_fops = {
 static int malidp_debugfs_init(struct drm_minor *minor)
 {
        struct malidp_drm *malidp = minor->dev->dev_private;
-       struct dentry *dentry = NULL;
 
        malidp_error_stats_init(&malidp->de_errors);
        malidp_error_stats_init(&malidp->se_errors);
        spin_lock_init(&malidp->errors_lock);
-       dentry = debugfs_create_file("debug",
-                                    S_IRUGO | S_IWUSR,
-                                    minor->debugfs_root, minor->dev,
-                                    &malidp_debugfs_fops);
-       if (!dentry) {
-               DRM_ERROR("Cannot create debug file\n");
-               return -ENOMEM;
-       }
+       debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root,
+                           minor->dev, &malidp_debugfs_fops);
        return 0;
 }