dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Wambui Karuga <wambui.karugax@gmail.com>
To: daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: [PATCH 01/21] drm/debugfs: remove checks for return value of drm_debugfs functions.
Date: Thu, 27 Feb 2020 15:02:12 +0300	[thread overview]
Message-ID: <20200227120232.19413-2-wambui.karugax@gmail.com> (raw)
In-Reply-To: <20200227120232.19413-1-wambui.karugax@gmail.com>

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 remove unnecessary checks
and error handling statement blocks for its return value.

These changes also enable changing drm_debugfs_create_files() to return
void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/drm_debugfs.c | 49 ++++++++---------------------------
 include/drm/drm_debugfs.h     |  6 ++---
 2 files changed, 14 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 4e673d318503..d77d2bdcfb2d 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -172,8 +172,8 @@ static const struct file_operations drm_debugfs_fops = {
  * &struct drm_info_list in the given root directory. These files will be removed
  * automatically on drm_debugfs_cleanup().
  */
-int drm_debugfs_create_files(const struct drm_info_list *files, int count,
-			     struct dentry *root, struct drm_minor *minor)
+void drm_debugfs_create_files(const struct drm_info_list *files, int count,
+			      struct dentry *root, struct drm_minor *minor)
 {
 	struct drm_device *dev = minor->dev;
 	struct drm_info_node *tmp;
@@ -199,7 +199,6 @@ int drm_debugfs_create_files(const struct drm_info_list *files, int count,
 		list_add(&tmp->list, &minor->debugfs_list);
 		mutex_unlock(&minor->debugfs_lock);
 	}
-	return 0;
 }
 EXPORT_SYMBOL(drm_debugfs_create_files);
 
@@ -208,56 +207,30 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 {
 	struct drm_device *dev = minor->dev;
 	char name[64];
-	int ret;
 
 	INIT_LIST_HEAD(&minor->debugfs_list);
 	mutex_init(&minor->debugfs_lock);
 	sprintf(name, "%d", minor_id);
 	minor->debugfs_root = debugfs_create_dir(name, root);
 
-	ret = drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
-				       minor->debugfs_root, minor);
-	if (ret) {
-		debugfs_remove(minor->debugfs_root);
-		minor->debugfs_root = NULL;
-		DRM_ERROR("Failed to create core drm debugfs files\n");
-		return ret;
-	}
+	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
+				 minor->debugfs_root, minor);
 
-	if (drm_drv_uses_atomic_modeset(dev)) {
-		ret = drm_atomic_debugfs_init(minor);
-		if (ret) {
-			DRM_ERROR("Failed to create atomic debugfs files\n");
-			return ret;
-		}
-	}
+	if (drm_drv_uses_atomic_modeset(dev))
+		drm_atomic_debugfs_init(minor);
 
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		ret = drm_framebuffer_debugfs_init(minor);
-		if (ret) {
-			DRM_ERROR("Failed to create framebuffer debugfs file\n");
-			return ret;
-		}
+		drm_framebuffer_debugfs_init(minor);
 
-		ret = drm_client_debugfs_init(minor);
-		if (ret) {
-			DRM_ERROR("Failed to create client debugfs file\n");
-			return ret;
-		}
+		drm_client_debugfs_init(minor);
 	}
 
-	if (dev->driver->debugfs_init) {
-		ret = dev->driver->debugfs_init(minor);
-		if (ret) {
-			DRM_ERROR("DRM: Driver failed to initialize "
-				  "/sys/kernel/debug/dri.\n");
-			return ret;
-		}
-	}
+	if (dev->driver->debugfs_init)
+		dev->driver->debugfs_init(minor);
+
 	return 0;
 }
 
-
 int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
 			     struct drm_minor *minor)
 {
diff --git a/include/drm/drm_debugfs.h b/include/drm/drm_debugfs.h
index 7501e323d383..4d028cc1fd37 100644
--- a/include/drm/drm_debugfs.h
+++ b/include/drm/drm_debugfs.h
@@ -80,9 +80,9 @@ struct drm_info_node {
 };
 
 #if defined(CONFIG_DEBUG_FS)
-int drm_debugfs_create_files(const struct drm_info_list *files,
-			     int count, struct dentry *root,
-			     struct drm_minor *minor);
+void drm_debugfs_create_files(const struct drm_info_list *files,
+			      int count, struct dentry *root,
+			      struct drm_minor *minor);
 int drm_debugfs_remove_files(const struct drm_info_list *files,
 			     int count, struct drm_minor *minor);
 #else
-- 
2.25.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-02-27 13:00 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
2020-02-27 12:02 ` Wambui Karuga [this message]
2020-02-27 12:02 ` [PATCH 02/21] drm: convert the drm_driver.debugfs_init() hook to return void Wambui Karuga
2020-02-27 12:23   ` Greg KH
2020-02-27 12:29     ` Wambui Karuga
2020-02-27 12:34       ` Greg KH
2020-02-27 12:02 ` [PATCH 03/21] drm: convert drm_debugfs functions " Wambui Karuga
2020-02-27 12:02 ` [PATCH 04/21] drm/vram-helper: make drm_vram_mm_debugfs_init() " Wambui Karuga
2020-02-28  8:03   ` Thomas Zimmermann
2020-02-27 12:02 ` [PATCH 05/21] drm/vc4: remove check of return value of drm_debugfs functions Wambui Karuga
2020-02-27 12:02 ` [PATCH 06/21] drm/arc: make arcpgu_debugfs_init return void Wambui Karuga
2020-02-27 14:43   ` Alexey Brodkin
2020-02-27 12:02 ` [PATCH 07/21] drm/arm: make hdlcd_debugfs_init() " Wambui Karuga
2020-02-27 14:53   ` Liviu Dudau
2020-02-27 12:02 ` [PATCH 08/21] drm/etnaviv: remove check for return value of drm_debugfs function Wambui Karuga
2020-02-27 13:36   ` Lucas Stach
2020-02-27 12:02 ` [PATCH 09/21] drm/nouveau: remove checks for return value of debugfs functions Wambui Karuga
2020-02-27 12:02 ` [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value Wambui Karuga
2020-03-11 14:37   ` Thierry Reding
2020-03-11 14:54     ` Wambui Karuga
2020-03-11 23:24       ` Thierry Reding
2020-03-16  8:33         ` Daniel Vetter
2020-02-27 12:02 ` [PATCH 11/21] drm/v3d: make v3d_debugfs_init return void Wambui Karuga
2020-02-27 12:02 ` [PATCH 12/21] drm/msm: remove checks for return value of drm_debugfs functions Wambui Karuga
2020-02-27 14:45   ` Daniel Vetter
2020-02-28  7:24   ` kbuild test robot
2020-02-27 12:02 ` [PATCH 13/21] drm/omapdrm: " Wambui Karuga
2020-02-27 12:02 ` [PATCH 14/21] drm/pl111: make pl111_debugfs_init return void Wambui Karuga
2020-02-27 12:02 ` [PATCH 15/21] drm/sti: remove use drm_debugfs functions as return value Wambui Karuga
2020-02-27 14:51   ` Daniel Vetter
2020-02-27 12:02 ` [PATCH 16/21] drm/i915: make *_debugfs_register() functions return void Wambui Karuga
2020-02-27 13:08   ` Jani Nikula
2020-02-27 12:02 ` [PATCH 17/21] drm/tilcdc: remove check for return value of debugfs functions Wambui Karuga
2020-02-27 12:12   ` Jyri Sarha
2020-02-27 12:23     ` Wambui Karuga
2020-02-27 12:02 ` [PATCH 18/21] drm/virtio: make virtio_gpu_debugfs() return void Wambui Karuga
2020-02-27 12:02 ` [PATCH 19/21] drm/mipi_dbi: make midi_dbi_debugfs_init() " Wambui Karuga
2020-02-27 12:02 ` [PATCH 20/21] drm/qxl: have debugfs functions " Wambui Karuga
2020-02-27 12:02 ` [PATCH 21/21] drm/arm: have malidp_debufs_init() " Wambui Karuga
2020-02-27 14:53   ` Liviu Dudau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200227120232.19413-2-wambui.karugax@gmail.com \
    --to=wambui.karugax@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).