LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 00/21] drm: subsytem-wide debugfs functions refactor
@ 2020-02-27 12:02 Wambui Karuga
  2020-02-27 12:02 ` [PATCH 01/21] drm/debugfs: remove checks for return value of drm_debugfs functions Wambui Karuga
                   ` (20 more replies)
  0 siblings, 21 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, tzimmermann
  Cc: linux-kernel, gregkh, dri-devel

This series includes work on various debugfs functions both in drm/core
and across various drivers in the subsystem.
Since commit 987d65d01356 (drm: debugfs: make drm_debugfs_create_files()
never fail), drm_debugfs_create_files() does not fail and only returns
zero. This series therefore removes the left over error handling and
checks for its return value across drm drivers.

As a result of these changes, most drm_debugfs functions are converted
to return void in this series. This also enables the
drm_driver,debugfs_init() hook to be changed to return void. 

Wambui Karuga (21):
  drm/debugfs: remove checks for return value of drm_debugfs functions.
  drm: convert the drm_driver.debugfs_init() hook to return void.
  drm: convert drm_debugfs functions to return void
  drm/vram-helper: make drm_vram_mm_debugfs_init() return void
  drm/vc4: remove check of return value of drm_debugfs functions
  drm/arc: make arcpgu_debugfs_init return void
  drm/arm: make hdlcd_debugfs_init() return void
  drm/etnaviv: remove check for return value of drm_debugfs function
  drm/nouveau: remove checks for return value of debugfs functions
  drm/tegra: remove checks for debugfs functions return value
  drm/v3d: make v3d_debugfs_init return void
  drm/msm: remove checks for return value of drm_debugfs functions.
  drm/omapdrm: remove checks for return value of drm_debugfs functions.
  drm/pl111: make pl111_debugfs_init return void
  drm/sti: remove use drm_debugfs functions as return value
  drm/i915: make *_debugfs_register() functions return void.
  drm/tilcdc: remove check for return value of debugfs functions.
  drm/virtio: make virtio_gpu_debugfs() return void.
  drm/mipi_dbi: make midi_dbi_debugfs_init() return void.
  drm/qxl: have debugfs functions return void.
  drm/arm: have malidp_debufs_init() return void

 drivers/gpu/drm/arc/arcpgu_drv.c              |  7 +--
 drivers/gpu/drm/arm/hdlcd_drv.c               |  7 +--
 drivers/gpu/drm/arm/malidp_drv.c              |  3 +-
 drivers/gpu/drm/drm_atomic.c                  |  8 +--
 drivers/gpu/drm/drm_client.c                  |  8 +--
 drivers/gpu/drm/drm_crtc_internal.h           |  2 +-
 drivers/gpu/drm/drm_debugfs.c                 | 49 +++++--------------
 drivers/gpu/drm/drm_framebuffer.c             |  8 +--
 drivers/gpu/drm/drm_gem_vram_helper.c         | 14 ++----
 drivers/gpu/drm/drm_internal.h                |  2 +-
 drivers/gpu/drm/drm_mipi_dbi.c                |  6 +--
 drivers/gpu/drm/etnaviv/etnaviv_drv.c         | 18 ++-----
 .../drm/i915/display/intel_display_debugfs.c  |  8 +--
 .../drm/i915/display/intel_display_debugfs.h  |  4 +-
 drivers/gpu/drm/i915/i915_debugfs.c           |  8 +--
 drivers/gpu/drm/i915/i915_debugfs.h           |  4 +-
 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c     | 18 ++-----
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c      | 14 ++----
 drivers/gpu/drm/msm/msm_debugfs.c             | 21 +++-----
 drivers/gpu/drm/msm/msm_debugfs.h             |  2 +-
 drivers/gpu/drm/msm/msm_gpu.h                 |  2 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c     | 26 ++++------
 drivers/gpu/drm/nouveau/nouveau_debugfs.h     |  5 +-
 drivers/gpu/drm/omapdrm/omap_debugfs.c        | 29 +++--------
 drivers/gpu/drm/omapdrm/omap_drv.h            |  2 +-
 drivers/gpu/drm/pl111/pl111_debugfs.c         |  8 +--
 drivers/gpu/drm/pl111/pl111_drm.h             |  2 +-
 drivers/gpu/drm/qxl/qxl_debugfs.c             | 21 +++-----
 drivers/gpu/drm/qxl/qxl_drv.h                 | 13 ++---
 drivers/gpu/drm/qxl/qxl_ttm.c                 |  6 +--
 drivers/gpu/drm/sti/sti_cursor.c              | 14 +++---
 drivers/gpu/drm/sti/sti_drv.c                 | 16 ++----
 drivers/gpu/drm/sti/sti_dvo.c                 | 13 ++---
 drivers/gpu/drm/sti/sti_gdp.c                 |  7 +--
 drivers/gpu/drm/sti/sti_hda.c                 | 13 ++---
 drivers/gpu/drm/sti/sti_hdmi.c                | 13 ++---
 drivers/gpu/drm/sti/sti_hqvdp.c               | 12 +++--
 drivers/gpu/drm/sti/sti_mixer.c               |  7 +--
 drivers/gpu/drm/sti/sti_tvout.c               | 13 ++---
 drivers/gpu/drm/sti/sti_vid.c                 |  8 +--
 drivers/gpu/drm/sti/sti_vid.h                 |  2 +-
 drivers/gpu/drm/tegra/dc.c                    | 11 +----
 drivers/gpu/drm/tegra/drm.c                   |  8 +--
 drivers/gpu/drm/tegra/dsi.c                   | 11 +----
 drivers/gpu/drm/tegra/hdmi.c                  | 11 +----
 drivers/gpu/drm/tegra/sor.c                   | 11 +----
 drivers/gpu/drm/tilcdc/tilcdc_drv.c           | 17 ++-----
 drivers/gpu/drm/v3d/v3d_debugfs.c             |  8 +--
 drivers/gpu/drm/v3d/v3d_drv.h                 |  2 +-
 drivers/gpu/drm/vc4/vc4_debugfs.c             | 11 ++---
 drivers/gpu/drm/vc4/vc4_drv.h                 |  2 +-
 drivers/gpu/drm/virtio/virtgpu_debugfs.c      |  3 +-
 drivers/gpu/drm/virtio/virtgpu_drv.h          |  2 +-
 include/drm/drm_client.h                      |  2 +-
 include/drm/drm_debugfs.h                     |  6 +--
 include/drm/drm_drv.h                         |  2 +-
 include/drm/drm_gem_vram_helper.h             |  2 +-
 include/drm/drm_mipi_dbi.h                    |  2 +-
 58 files changed, 192 insertions(+), 362 deletions(-)

-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 01/21] drm/debugfs: remove checks for return value of drm_debugfs functions.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 02/21] drm: convert the drm_driver.debugfs_init() hook to return void Wambui Karuga
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, tzimmermann, maarten.lankhorst, mripard
  Cc: linux-kernel, gregkh, dri-devel

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


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 02/21] drm: convert the drm_driver.debugfs_init() hook to return void.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
  2020-02-27 12:02 ` [PATCH 01/21] drm/debugfs: remove checks for return value of drm_debugfs functions Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:23   ` Greg KH
  2020-02-27 12:02 ` [PATCH 03/21] drm: convert drm_debugfs functions " Wambui Karuga
                   ` (18 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, mripard, maarten.lankhorst, tzimmermann
  Cc: linux-kernel, gregkh, dri-devel

As a result of commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail) and changes to various debugfs
functions in drm/core and across various drivers, there is no need for
the drm_driver.debugfs_init() hook to have a return value. Therefore,
declare it as void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 include/drm/drm_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 97109df5beac..c6ae888c672b 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -323,7 +323,7 @@ struct drm_driver {
 	 *
 	 * Allows drivers to create driver-specific debugfs files.
 	 */
-	int (*debugfs_init)(struct drm_minor *minor);
+	void (*debugfs_init)(struct drm_minor *minor);
 
 	/**
 	 * @gem_free_object: deconstructor for drm_gem_objects
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 03/21] drm: convert drm_debugfs functions to return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
  2020-02-27 12:02 ` [PATCH 01/21] drm/debugfs: remove checks for return value of drm_debugfs functions Wambui Karuga
  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:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 04/21] drm/vram-helper: make drm_vram_mm_debugfs_init() " Wambui Karuga
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, tzimmermann
  Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never
fail), drm_debug_create_files() never fails and should return void.
Therefore, drop return value from various drm_debugfs functions that return
drm_debug_create_files() and convert the functions to return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/drm_atomic.c        | 8 ++++----
 drivers/gpu/drm/drm_client.c        | 8 ++++----
 drivers/gpu/drm/drm_crtc_internal.h | 2 +-
 drivers/gpu/drm/drm_framebuffer.c   | 8 ++++----
 drivers/gpu/drm/drm_internal.h      | 2 +-
 include/drm/drm_client.h            | 2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 9ccfbf213d72..965173fd0ac2 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1641,10 +1641,10 @@ static const struct drm_info_list drm_atomic_debugfs_list[] = {
 	{"state", drm_state_info, 0},
 };
 
-int drm_atomic_debugfs_init(struct drm_minor *minor)
+void drm_atomic_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(drm_atomic_debugfs_list,
-			ARRAY_SIZE(drm_atomic_debugfs_list),
-			minor->debugfs_root, minor);
+	drm_debugfs_create_files(drm_atomic_debugfs_list,
+				 ARRAY_SIZE(drm_atomic_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
index b031b45aa8ef..2a147d1c3a13 100644
--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -457,10 +457,10 @@ static const struct drm_info_list drm_client_debugfs_list[] = {
 	{ "internal_clients", drm_client_debugfs_internal_clients, 0 },
 };
 
-int drm_client_debugfs_init(struct drm_minor *minor)
+void drm_client_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(drm_client_debugfs_list,
-					ARRAY_SIZE(drm_client_debugfs_list),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(drm_client_debugfs_list,
+				 ARRAY_SIZE(drm_client_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
index 16f2413403aa..1b620ba9244b 100644
--- a/drivers/gpu/drm/drm_crtc_internal.h
+++ b/drivers/gpu/drm/drm_crtc_internal.h
@@ -224,7 +224,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
 /* drm_atomic.c */
 #ifdef CONFIG_DEBUG_FS
 struct drm_minor;
-int drm_atomic_debugfs_init(struct drm_minor *minor);
+void drm_atomic_debugfs_init(struct drm_minor *minor);
 #endif
 
 int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 57ac94ce9b9e..0375b3d7f8d0 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -1207,10 +1207,10 @@ static const struct drm_info_list drm_framebuffer_debugfs_list[] = {
 	{ "framebuffer", drm_framebuffer_info, 0 },
 };
 
-int drm_framebuffer_debugfs_init(struct drm_minor *minor)
+void drm_framebuffer_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(drm_framebuffer_debugfs_list,
-				ARRAY_SIZE(drm_framebuffer_debugfs_list),
-				minor->debugfs_root, minor);
+	drm_debugfs_create_files(drm_framebuffer_debugfs_list,
+				 ARRAY_SIZE(drm_framebuffer_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index aeec2e68d772..f0c99d00b201 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -235,7 +235,7 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
 /* drm_framebuffer.c */
 void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
 				const struct drm_framebuffer *fb);
-int drm_framebuffer_debugfs_init(struct drm_minor *minor);
+void drm_framebuffer_debugfs_init(struct drm_minor *minor);
 
 /* drm_hdcp.c */
 int drm_setup_hdcp_srm(struct class *drm_class);
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index 3ed5dee899fd..7402f852d3c4 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -188,6 +188,6 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
 	drm_for_each_connector_iter(connector, iter) \
 		if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK)
 
-int drm_client_debugfs_init(struct drm_minor *minor);
+void drm_client_debugfs_init(struct drm_minor *minor);
 
 #endif
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 04/21] drm/vram-helper: make drm_vram_mm_debugfs_init() return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (2 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 03/21] drm: convert drm_debugfs functions " Wambui Karuga
@ 2020-02-27 12:02 ` 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
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
  Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails and should return void. Therefore, remove its use as the
return value of drm_vram_mm_debugfs_init(), and have the function
declared as void instead.

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

diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index 92a11bb42365..76506bedac11 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -1042,20 +1042,14 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
  *
  * @minor: drm minor device.
  *
- * Returns:
- * 0 on success, or
- * a negative error code otherwise.
  */
-int drm_vram_mm_debugfs_init(struct drm_minor *minor)
+void drm_vram_mm_debugfs_init(struct drm_minor *minor)
 {
-	int ret = 0;
-
 #if defined(CONFIG_DEBUG_FS)
-	ret = drm_debugfs_create_files(drm_vram_mm_debugfs_list,
-				       ARRAY_SIZE(drm_vram_mm_debugfs_list),
-				       minor->debugfs_root, minor);
+	drm_debugfs_create_files(drm_vram_mm_debugfs_list,
+				 ARRAY_SIZE(drm_vram_mm_debugfs_list),
+				 minor->debugfs_root, minor);
 #endif
-	return ret;
 }
 EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
 
diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
index 0f6e47213d8d..b63bcd1b996d 100644
--- a/include/drm/drm_gem_vram_helper.h
+++ b/include/drm/drm_gem_vram_helper.h
@@ -196,7 +196,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev(
 	return container_of(bdev, struct drm_vram_mm, bdev);
 }
 
-int drm_vram_mm_debugfs_init(struct drm_minor *minor);
+void drm_vram_mm_debugfs_init(struct drm_minor *minor);
 
 /*
  * Helpers for integration with struct drm_device
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 05/21] drm/vc4: remove check of return value of drm_debugfs functions
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (3 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 04/21] drm/vram-helper: make drm_vram_mm_debugfs_init() " Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 06/21] drm/arc: make arcpgu_debugfs_init return void Wambui Karuga
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Eric Anholt; +Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails and should return void. Therefore, remove unnecessary check and
error handling for the return value of drm_debugfs_create_files()
in vc4_debugfs_init().

This change also allows vc4_debugfs_init() to be declared as void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/vc4/vc4_debugfs.c | 11 +++--------
 drivers/gpu/drm/vc4/vc4_drv.h     |  2 +-
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c
index b61b2d3407b5..4fbbf980a299 100644
--- a/drivers/gpu/drm/vc4/vc4_debugfs.c
+++ b/drivers/gpu/drm/vc4/vc4_debugfs.c
@@ -20,7 +20,7 @@ struct vc4_debugfs_info_entry {
  * Called at drm_dev_register() time on each of the minors registered
  * by the DRM device, to attach the debugfs files.
  */
-int
+void
 vc4_debugfs_init(struct drm_minor *minor)
 {
 	struct vc4_dev *vc4 = to_vc4_dev(minor->dev);
@@ -30,14 +30,9 @@ vc4_debugfs_init(struct drm_minor *minor)
 			    minor->debugfs_root, &vc4->load_tracker_enabled);
 
 	list_for_each_entry(entry, &vc4->debugfs_list, link) {
-		int ret = drm_debugfs_create_files(&entry->info, 1,
-						   minor->debugfs_root, minor);
-
-		if (ret)
-			return ret;
+		drm_debugfs_create_files(&entry->info, 1,
+					 minor->debugfs_root, minor);
 	}
-
-	return 0;
 }
 
 static int vc4_debugfs_regset32(struct seq_file *m, void *unused)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index f90c0d08e740..cd0f9ef41fa2 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -750,7 +750,7 @@ void vc4_crtc_get_margins(struct drm_crtc_state *state,
 			  unsigned int *top, unsigned int *bottom);
 
 /* vc4_debugfs.c */
-int vc4_debugfs_init(struct drm_minor *minor);
+void vc4_debugfs_init(struct drm_minor *minor);
 #ifdef CONFIG_DEBUG_FS
 void vc4_debugfs_add_file(struct drm_device *drm,
 			  const char *filename,
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 06/21] drm/arc: make arcpgu_debugfs_init return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (4 preceding siblings ...)
  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 ` 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
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Alexey Brodkin; +Cc: linux-kernel, gregkh, dri-devel

Since commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files never
fails and should return void. Therefore, remove its use as the
return value of arcpgu_debugfs_init and have the latter function also
return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/arc/arcpgu_drv.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index d6a6692db0ac..c05d001163e0 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -137,10 +137,11 @@ static struct drm_info_list arcpgu_debugfs_list[] = {
 	{ "clocks", arcpgu_show_pxlclock, 0 },
 };
 
-static int arcpgu_debugfs_init(struct drm_minor *minor)
+static void arcpgu_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(arcpgu_debugfs_list,
-		ARRAY_SIZE(arcpgu_debugfs_list), minor->debugfs_root, minor);
+	drm_debugfs_create_files(arcpgu_debugfs_list,
+				 ARRAY_SIZE(arcpgu_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 07/21] drm/arm: make hdlcd_debugfs_init() return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (5 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 06/21] drm/arc: make arcpgu_debugfs_init return void Wambui Karuga
@ 2020-02-27 12:02 ` 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
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Liviu Dudau, Brian Starkey
  Cc: linux-kernel, gregkh, dri-devel

Since commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files()
never fails, and should return void. Therefore, remove its use as a
return value in hdlcd_debugfs_init and have the latter function
return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/arm/hdlcd_drv.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 2e053815b54a..194419f47c5e 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -224,10 +224,11 @@ static struct drm_info_list hdlcd_debugfs_list[] = {
 	{ "clocks", hdlcd_show_pxlclock, 0 },
 };
 
-static int hdlcd_debugfs_init(struct drm_minor *minor)
+static void hdlcd_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(hdlcd_debugfs_list,
-		ARRAY_SIZE(hdlcd_debugfs_list),	minor->debugfs_root, minor);
+	drm_debugfs_create_files(hdlcd_debugfs_list,
+				 ARRAY_SIZE(hdlcd_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 08/21] drm/etnaviv: remove check for return value of drm_debugfs function
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (6 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 07/21] drm/arm: make hdlcd_debugfs_init() " Wambui Karuga
@ 2020-02-27 12:02 ` 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
                   ` (12 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Lucas Stach, Russell King, Christian Gmeiner
  Cc: linux-kernel, gregkh, etnaviv, dri-devel

Since commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_file only
returns 0, and there is no need to check the return value.
This change therefore removes the check and error handling in
etnaviv_debugfs_init() and also makes the function return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 6b43c1c94e8f..a39735316ca5 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -231,21 +231,11 @@ static struct drm_info_list etnaviv_debugfs_list[] = {
 		{"ring", show_each_gpu, 0, etnaviv_ring_show},
 };
 
-static int etnaviv_debugfs_init(struct drm_minor *minor)
+static void etnaviv_debugfs_init(struct drm_minor *minor)
 {
-	struct drm_device *dev = minor->dev;
-	int ret;
-
-	ret = drm_debugfs_create_files(etnaviv_debugfs_list,
-			ARRAY_SIZE(etnaviv_debugfs_list),
-			minor->debugfs_root, minor);
-
-	if (ret) {
-		dev_err(dev->dev, "could not install etnaviv_debugfs_list\n");
-		return ret;
-	}
-
-	return ret;
+	drm_debugfs_create_files(etnaviv_debugfs_list,
+				 ARRAY_SIZE(etnaviv_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 09/21] drm/nouveau: remove checks for return value of debugfs functions
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (7 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 08/21] drm/etnaviv: remove check for return value of drm_debugfs function Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value Wambui Karuga
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, bskeggs; +Cc: linux-kernel, gregkh, dri-devel, nouveau

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), there is no need to ever check
for the the return value of debugfs_create_file() and
drm_debugfs_create_files(). Therefore, remove unnecessary checks and
error handling in nouveau_drm_debugfs_init.

These changes also enable nouveau_drm_debugfs_init() to be declared
as void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 26 +++++++++--------------
 drivers/gpu/drm/nouveau/nouveau_debugfs.h |  5 ++---
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 7dfbbbc1beea..63cb5e432f8a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -217,39 +217,33 @@ static const struct nouveau_debugfs_files {
 	{"pstate", &nouveau_pstate_fops},
 };
 
-int
+void
 nouveau_drm_debugfs_init(struct drm_minor *minor)
 {
 	struct nouveau_drm *drm = nouveau_drm(minor->dev);
 	struct dentry *dentry;
-	int i, ret;
+	int i;
 
 	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) {
-		dentry = debugfs_create_file(nouveau_debugfs_files[i].name,
-					     S_IRUGO | S_IWUSR,
-					     minor->debugfs_root, minor->dev,
-					     nouveau_debugfs_files[i].fops);
-		if (!dentry)
-			return -ENOMEM;
+		debugfs_create_file(nouveau_debugfs_files[i].name,
+				    S_IRUGO | S_IWUSR,
+				    minor->debugfs_root, minor->dev,
+				    nouveau_debugfs_files[i].fops);
 	}
 
-	ret = drm_debugfs_create_files(nouveau_debugfs_list,
-				       NOUVEAU_DEBUGFS_ENTRIES,
-				       minor->debugfs_root, minor);
-	if (ret)
-		return ret;
+	drm_debugfs_create_files(nouveau_debugfs_list,
+				 NOUVEAU_DEBUGFS_ENTRIES,
+				 minor->debugfs_root, minor);
 
 	/* Set the size of the vbios since we know it, and it's confusing to
 	 * userspace if it wants to seek() but the file has a length of 0
 	 */
 	dentry = debugfs_lookup("vbios.rom", minor->debugfs_root);
 	if (!dentry)
-		return 0;
+		return;
 
 	d_inode(dentry)->i_size = drm->vbios.length;
 	dput(dentry);
-
-	return 0;
 }
 
 int
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.h b/drivers/gpu/drm/nouveau/nouveau_debugfs.h
index 8909c010e8ea..ccb842d9da87 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.h
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.h
@@ -18,14 +18,13 @@ nouveau_debugfs(struct drm_device *dev)
 	return nouveau_drm(dev)->debugfs;
 }
 
-extern int  nouveau_drm_debugfs_init(struct drm_minor *);
+extern void nouveau_drm_debugfs_init(struct drm_minor *);
 extern int  nouveau_debugfs_init(struct nouveau_drm *);
 extern void nouveau_debugfs_fini(struct nouveau_drm *);
 #else
-static inline int
+static inline void
 nouveau_drm_debugfs_init(struct drm_minor *minor)
 {
-       return 0;
 }
 
 static inline int
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (8 preceding siblings ...)
  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 ` Wambui Karuga
  2020-03-11 14:37   ` Thierry Reding
  2020-02-27 12:02 ` [PATCH 11/21] drm/v3d: make v3d_debugfs_init return void Wambui Karuga
                   ` (10 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Thierry Reding, Jonathan Hunter
  Cc: linux-kernel, gregkh, dri-devel, linux-tegra

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.

This change also includes removing the use of drm_debugfs_create_files
as a return value in tegra_debugfs_init() and have the function declared
as void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/tegra/dc.c   | 11 +----------
 drivers/gpu/drm/tegra/drm.c  |  8 ++++----
 drivers/gpu/drm/tegra/dsi.c  | 11 +----------
 drivers/gpu/drm/tegra/hdmi.c | 11 +----------
 drivers/gpu/drm/tegra/sor.c  | 11 +----------
 5 files changed, 8 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 7c70fd31a4c2..e70d58b21964 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -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)
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index bd268028fb3d..d4f51b5c7ee5 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -839,11 +839,11 @@ static struct drm_info_list tegra_debugfs_list[] = {
 	{ "iova", tegra_debugfs_iova, 0 },
 };
 
-static int tegra_debugfs_init(struct drm_minor *minor)
+static void 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);
 }
 #endif
 
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 88b9d64c77bf..30626fcf61eb 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -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)
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 6f117628f257..d7799d13d8ad 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -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)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 81226a4953c1..47c1d133069a 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -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)
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 11/21] drm/v3d: make v3d_debugfs_init return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (9 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 12/21] drm/msm: remove checks for return value of drm_debugfs functions Wambui Karuga
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Eric Anholt; +Cc: linux-kernel, gregkh, dri-devel

Since commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails and should return void. Therefore, remove its use as the
return value of v3d_debugfs_init and have the function return void
instead.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/v3d/v3d_debugfs.c | 8 ++++----
 drivers/gpu/drm/v3d/v3d_drv.h     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_debugfs.c b/drivers/gpu/drm/v3d/v3d_debugfs.c
index 9e953ce64ef7..2b0ea5f8febd 100644
--- a/drivers/gpu/drm/v3d/v3d_debugfs.c
+++ b/drivers/gpu/drm/v3d/v3d_debugfs.c
@@ -258,10 +258,10 @@ static const struct drm_info_list v3d_debugfs_list[] = {
 	{"bo_stats", v3d_debugfs_bo_stats, 0},
 };
 
-int
+void
 v3d_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(v3d_debugfs_list,
-					ARRAY_SIZE(v3d_debugfs_list),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(v3d_debugfs_list,
+				 ARRAY_SIZE(v3d_debugfs_list),
+				 minor->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h
index 9a35c555ec52..4dd4772f5f27 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.h
+++ b/drivers/gpu/drm/v3d/v3d_drv.h
@@ -301,7 +301,7 @@ struct drm_gem_object *v3d_prime_import_sg_table(struct drm_device *dev,
 						 struct sg_table *sgt);
 
 /* v3d_debugfs.c */
-int v3d_debugfs_init(struct drm_minor *minor);
+void v3d_debugfs_init(struct drm_minor *minor);
 
 /* v3d_fence.c */
 extern const struct dma_fence_ops v3d_fence_ops;
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 12/21] drm/msm: remove checks for return value of drm_debugfs functions.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (10 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 11/21] drm/v3d: make v3d_debugfs_init return void Wambui Karuga
@ 2020-02-27 12:02 ` 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
                   ` (8 subsequent siblings)
  20 siblings, 2 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Rob Clark, Sean Paul
  Cc: linux-kernel, gregkh, dri-devel, linux-arm-msm, freedreno

Since commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() does
not fail, and should return void. This change therefore removes the
checks of its return value in drm/msm and subsequent error handling.

These changes also enable the changing of various debugfs_init()
functions to return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 18 +++++-------------
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c  | 14 +++-----------
 drivers/gpu/drm/msm/msm_debugfs.c         | 21 ++++++---------------
 drivers/gpu/drm/msm/msm_debugfs.h         |  2 +-
 drivers/gpu/drm/msm/msm_gpu.h             |  2 +-
 5 files changed, 16 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index 075ecce4b5e0..8cae2ca4af6b 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -148,27 +148,19 @@ reset_set(void *data, u64 val)
 DEFINE_SIMPLE_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n");
 
 
-int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
+void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
 {
 	struct drm_device *dev;
-	int ret;
 
 	if (!minor)
-		return 0;
+		return;
 
 	dev = minor->dev;
 
-	ret = drm_debugfs_create_files(a5xx_debugfs_list,
-			ARRAY_SIZE(a5xx_debugfs_list),
-			minor->debugfs_root, minor);
-
-	if (ret) {
-		DRM_DEV_ERROR(dev->dev, "could not install a5xx_debugfs_list\n");
-		return ret;
-	}
+	drm_debugfs_create_files(a5xx_debugfs_list,
+				 ARRAY_SIZE(a5xx_debugfs_list),
+				 minor->debugfs_root, minor);
 
 	debugfs_create_file("reset", S_IWUGO, minor->debugfs_root, dev,
 			    &reset_fops);
-
-	return 0;
 }
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
index 6650f478b226..41b461128bbc 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
@@ -259,17 +259,9 @@ static struct drm_info_list mdp5_debugfs_list[] = {
 
 static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
 {
-	struct drm_device *dev = minor->dev;
-	int ret;
-
-	ret = drm_debugfs_create_files(mdp5_debugfs_list,
-			ARRAY_SIZE(mdp5_debugfs_list),
-			minor->debugfs_root, minor);
-
-	if (ret) {
-		DRM_DEV_ERROR(dev->dev, "could not install mdp5_debugfs_list\n");
-		return ret;
-	}
+	drm_debugfs_create_files(mdp5_debugfs_list,
+				 ARRAY_SIZE(mdp5_debugfs_list),
+				 minor->debugfs_root, minor);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
index 1c74381a4fc9..3c958f311bbc 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -214,31 +214,22 @@ int msm_debugfs_late_init(struct drm_device *dev)
 	return ret;
 }
 
-int msm_debugfs_init(struct drm_minor *minor)
+void msm_debugfs_init(struct drm_minor *minor)
 {
 	struct drm_device *dev = minor->dev;
 	struct msm_drm_private *priv = dev->dev_private;
-	int ret;
+	int ret = 0;
 
-	ret = drm_debugfs_create_files(msm_debugfs_list,
-			ARRAY_SIZE(msm_debugfs_list),
-			minor->debugfs_root, minor);
-
-	if (ret) {
-		DRM_DEV_ERROR(dev->dev, "could not install msm_debugfs_list\n");
-		return ret;
-	}
+	drm_debugfs_create_files(msm_debugfs_list,
+				 ARRAY_SIZE(msm_debugfs_list),
+				 minor->debugfs_root, minor);
 
 	debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root,
 		dev, &msm_gpu_fops);
 
 	if (priv->kms && priv->kms->funcs->debugfs_init) {
-		ret = priv->kms->funcs->debugfs_init(priv->kms, minor);
-		if (ret)
-			return ret;
+		priv->kms->funcs->debugfs_init(priv->kms, minor);
 	}
-
-	return ret;
 }
 #endif
 
diff --git a/drivers/gpu/drm/msm/msm_debugfs.h b/drivers/gpu/drm/msm/msm_debugfs.h
index 2b91f8c178ad..ef58f66abbb3 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.h
+++ b/drivers/gpu/drm/msm/msm_debugfs.h
@@ -8,7 +8,7 @@
 #define __MSM_DEBUGFS_H__
 
 #ifdef CONFIG_DEBUG_FS
-int msm_debugfs_init(struct drm_minor *minor);
+void msm_debugfs_init(struct drm_minor *minor);
 #endif
 
 #endif /* __MSM_DEBUGFS_H__ */
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index be5bc2e8425c..6ccae4ba905c 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -57,7 +57,7 @@ struct msm_gpu_funcs {
 	void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
 			struct drm_printer *p);
 	/* for generation specific debugfs: */
-	int (*debugfs_init)(struct msm_gpu *gpu, struct drm_minor *minor);
+	void (*debugfs_init)(struct msm_gpu *gpu, struct drm_minor *minor);
 #endif
 	unsigned long (*gpu_busy)(struct msm_gpu *gpu);
 	struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu);
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 13/21] drm/omapdrm: remove checks for return value of drm_debugfs functions.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (11 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 12/21] drm/msm: remove checks for return value of drm_debugfs functions Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 14/21] drm/pl111: make pl111_debugfs_init return void Wambui Karuga
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Tomi Valkeinen; +Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), there is no need to ever check
the return value for drm_debugfs_create_files(). Therefore remove the
checks for the return value and subsequent error handling in
omap_debugfs_init().

These changes also enables the changing of omap_debugfs_init() to return
void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/omapdrm/omap_debugfs.c | 29 +++++++-------------------
 drivers/gpu/drm/omapdrm/omap_drv.h     |  2 +-
 2 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c
index 34dfb33145b4..b57fbe8a0ac2 100644
--- a/drivers/gpu/drm/omapdrm/omap_debugfs.c
+++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c
@@ -80,31 +80,16 @@ static struct drm_info_list omap_dmm_debugfs_list[] = {
 	{"tiler_map", tiler_map_show, 0},
 };
 
-int omap_debugfs_init(struct drm_minor *minor)
+void omap_debugfs_init(struct drm_minor *minor)
 {
-	struct drm_device *dev = minor->dev;
-	int ret;
-
-	ret = drm_debugfs_create_files(omap_debugfs_list,
-			ARRAY_SIZE(omap_debugfs_list),
-			minor->debugfs_root, minor);
-
-	if (ret) {
-		dev_err(dev->dev, "could not install omap_debugfs_list\n");
-		return ret;
-	}
+	drm_debugfs_create_files(omap_debugfs_list,
+				 ARRAY_SIZE(omap_debugfs_list),
+				 minor->debugfs_root, minor);
 
 	if (dmm_is_available())
-		ret = drm_debugfs_create_files(omap_dmm_debugfs_list,
-				ARRAY_SIZE(omap_dmm_debugfs_list),
-				minor->debugfs_root, minor);
-
-	if (ret) {
-		dev_err(dev->dev, "could not install omap_dmm_debugfs_list\n");
-		return ret;
-	}
-
-	return ret;
+		drm_debugfs_create_files(omap_dmm_debugfs_list,
+					 ARRAY_SIZE(omap_dmm_debugfs_list),
+					 minor->debugfs_root, minor);
 }
 
 #endif
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 7c4b66efcaa7..8a1fac680138 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -82,6 +82,6 @@ struct omap_drm_private {
 };
 
 
-int omap_debugfs_init(struct drm_minor *minor);
+void omap_debugfs_init(struct drm_minor *minor);
 
 #endif /* __OMAPDRM_DRV_H__ */
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 14/21] drm/pl111: make pl111_debugfs_init return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (12 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 13/21] drm/omapdrm: " Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 15/21] drm/sti: remove use drm_debugfs functions as return value Wambui Karuga
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Eric Anholt; +Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail) drm_debugfs_create_files()
should return void. Therefore, remove its use as the return value in
pl111_debugfs_init, and have the function declared as void instead.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/pl111/pl111_debugfs.c | 8 ++++----
 drivers/gpu/drm/pl111/pl111_drm.h     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl111/pl111_debugfs.c
index 3c8e82016854..26ca8cdf3e60 100644
--- a/drivers/gpu/drm/pl111/pl111_debugfs.c
+++ b/drivers/gpu/drm/pl111/pl111_debugfs.c
@@ -51,10 +51,10 @@ static const struct drm_info_list pl111_debugfs_list[] = {
 	{"regs", pl111_debugfs_regs, 0},
 };
 
-int
+void
 pl111_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(pl111_debugfs_list,
-					ARRAY_SIZE(pl111_debugfs_list),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(pl111_debugfs_list,
+				 ARRAY_SIZE(pl111_debugfs_list),
+				 minor->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index 77d2da9a8a7c..ba399bcb792f 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -84,6 +84,6 @@ struct pl111_drm_dev_private {
 
 int pl111_display_init(struct drm_device *dev);
 irqreturn_t pl111_irq(int irq, void *data);
-int pl111_debugfs_init(struct drm_minor *minor);
+void pl111_debugfs_init(struct drm_minor *minor);
 
 #endif /* _PL111_DRM_H_ */
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 15/21] drm/sti: remove use drm_debugfs functions as return value
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (13 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 14/21] drm/pl111: make pl111_debugfs_init return void Wambui Karuga
@ 2020-02-27 12:02 ` 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
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Benjamin Gaignard, Vincent Abriou
  Cc: linux-kernel, gregkh, dri-devel

Since commit 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails, and should return void. This change therefore removes it uses as
a return value in various functions across drm/sti.

With these changes, the affected functions have been changed to use a void
return value.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/sti/sti_cursor.c | 14 ++++++++------
 drivers/gpu/drm/sti/sti_drv.c    | 16 ++++------------
 drivers/gpu/drm/sti/sti_dvo.c    | 13 +++++--------
 drivers/gpu/drm/sti/sti_gdp.c    |  7 ++++---
 drivers/gpu/drm/sti/sti_hda.c    | 13 +++++--------
 drivers/gpu/drm/sti/sti_hdmi.c   | 13 +++++--------
 drivers/gpu/drm/sti/sti_hqvdp.c  | 12 +++++++-----
 drivers/gpu/drm/sti/sti_mixer.c  |  7 ++++---
 drivers/gpu/drm/sti/sti_tvout.c  | 13 +++++--------
 drivers/gpu/drm/sti/sti_vid.c    |  8 ++++----
 drivers/gpu/drm/sti/sti_vid.h    |  2 +-
 11 files changed, 52 insertions(+), 66 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index ea64c1dcaf63..a98057431023 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -131,17 +131,17 @@ static struct drm_info_list cursor_debugfs_files[] = {
 	{ "cursor", cursor_dbg_show, 0, NULL },
 };
 
-static int cursor_debugfs_init(struct sti_cursor *cursor,
-			       struct drm_minor *minor)
+static void cursor_debugfs_init(struct sti_cursor *cursor,
+				struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(cursor_debugfs_files); i++)
 		cursor_debugfs_files[i].data = cursor;
 
-	return drm_debugfs_create_files(cursor_debugfs_files,
-					ARRAY_SIZE(cursor_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(cursor_debugfs_files,
+				 ARRAY_SIZE(cursor_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src)
@@ -342,7 +342,9 @@ static int sti_cursor_late_register(struct drm_plane *drm_plane)
 	struct sti_plane *plane = to_sti_plane(drm_plane);
 	struct sti_cursor *cursor = to_sti_cursor(plane);
 
-	return cursor_debugfs_init(cursor, drm_plane->dev->primary);
+	cursor_debugfs_init(cursor, drm_plane->dev->primary);
+
+	return 0;
 }
 
 static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = {
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 50870d8cbb76..3f9db3e3f397 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -92,24 +92,16 @@ static struct drm_info_list sti_drm_dbg_list[] = {
 	{"fps_get", sti_drm_fps_dbg_show, 0},
 };
 
-static int sti_drm_dbg_init(struct drm_minor *minor)
+static void sti_drm_dbg_init(struct drm_minor *minor)
 {
-	int ret;
-
-	ret = drm_debugfs_create_files(sti_drm_dbg_list,
-				       ARRAY_SIZE(sti_drm_dbg_list),
-				       minor->debugfs_root, minor);
-	if (ret)
-		goto err;
+	drm_debugfs_create_files(sti_drm_dbg_list,
+				 ARRAY_SIZE(sti_drm_dbg_list),
+				 minor->debugfs_root, minor);
 
 	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root,
 			    minor->dev, &sti_drm_fps_fops);
 
 	DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
-	return 0;
-err:
-	DRM_ERROR("%s: cannot install debugfs\n", DRIVER_NAME);
-	return ret;
 }
 
 static const struct drm_mode_config_funcs sti_mode_config_funcs = {
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index a0709647f678..0032e1830bc5 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -197,16 +197,16 @@ static struct drm_info_list dvo_debugfs_files[] = {
 	{ "dvo", dvo_dbg_show, 0, NULL },
 };
 
-static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
+static void dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(dvo_debugfs_files); i++)
 		dvo_debugfs_files[i].data = dvo;
 
-	return drm_debugfs_create_files(dvo_debugfs_files,
-					ARRAY_SIZE(dvo_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(dvo_debugfs_files,
+				 ARRAY_SIZE(dvo_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 static void sti_dvo_disable(struct drm_bridge *bridge)
@@ -406,10 +406,7 @@ static int sti_dvo_late_register(struct drm_connector *connector)
 		= to_sti_dvo_connector(connector);
 	struct sti_dvo *dvo = dvo_connector->dvo;
 
-	if (dvo_debugfs_init(dvo, dvo->drm_dev->primary)) {
-		DRM_ERROR("DVO debugfs setup failed\n");
-		return -EINVAL;
-	}
+	dvo_debugfs_init(dvo, dvo->drm_dev->primary);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 11595c748844..2d5a2b5b78b8 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -343,9 +343,10 @@ static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor)
 	for (i = 0; i < nb_files; i++)
 		gdp_debugfs_files[i].data = gdp;
 
-	return drm_debugfs_create_files(gdp_debugfs_files,
-					nb_files,
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(gdp_debugfs_files,
+				 nb_files,
+				 minor->debugfs_root, minor);
+	return 0;
 }
 
 static int sti_gdp_fourcc2format(int fourcc)
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index f3f28d79b0e4..a1ec891eaf3a 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -367,16 +367,16 @@ static struct drm_info_list hda_debugfs_files[] = {
 	{ "hda", hda_dbg_show, 0, NULL },
 };
 
-static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
+static void hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(hda_debugfs_files); i++)
 		hda_debugfs_files[i].data = hda;
 
-	return drm_debugfs_create_files(hda_debugfs_files,
-					ARRAY_SIZE(hda_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(hda_debugfs_files,
+				 ARRAY_SIZE(hda_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 /**
@@ -643,10 +643,7 @@ static int sti_hda_late_register(struct drm_connector *connector)
 		= to_sti_hda_connector(connector);
 	struct sti_hda *hda = hda_connector->hda;
 
-	if (hda_debugfs_init(hda, hda->drm_dev->primary)) {
-		DRM_ERROR("HDA debugfs setup failed\n");
-		return -EINVAL;
-	}
+	hda_debugfs_init(hda, hda->drm_dev->primary);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 18eaf786ffa4..5b15c4974e6b 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -727,16 +727,16 @@ static struct drm_info_list hdmi_debugfs_files[] = {
 	{ "hdmi", hdmi_dbg_show, 0, NULL },
 };
 
-static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
+static void hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(hdmi_debugfs_files); i++)
 		hdmi_debugfs_files[i].data = hdmi;
 
-	return drm_debugfs_create_files(hdmi_debugfs_files,
-					ARRAY_SIZE(hdmi_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(hdmi_debugfs_files,
+				 ARRAY_SIZE(hdmi_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 static void sti_hdmi_disable(struct drm_bridge *bridge)
@@ -1113,10 +1113,7 @@ static int sti_hdmi_late_register(struct drm_connector *connector)
 		= to_sti_hdmi_connector(connector);
 	struct sti_hdmi *hdmi = hdmi_connector->hdmi;
 
-	if (hdmi_debugfs_init(hdmi, hdmi->drm_dev->primary)) {
-		DRM_ERROR("HDMI debugfs setup failed\n");
-		return -EINVAL;
-	}
+	hdmi_debugfs_init(hdmi, hdmi->drm_dev->primary);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 1015abe0ce08..5a4e12194a77 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -639,16 +639,16 @@ static struct drm_info_list hqvdp_debugfs_files[] = {
 	{ "hqvdp", hqvdp_dbg_show, 0, NULL },
 };
 
-static int hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor)
+static void hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(hqvdp_debugfs_files); i++)
 		hqvdp_debugfs_files[i].data = hqvdp;
 
-	return drm_debugfs_create_files(hqvdp_debugfs_files,
-					ARRAY_SIZE(hqvdp_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(hqvdp_debugfs_files,
+				 ARRAY_SIZE(hqvdp_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 /**
@@ -1274,7 +1274,9 @@ static int sti_hqvdp_late_register(struct drm_plane *drm_plane)
 	struct sti_plane *plane = to_sti_plane(drm_plane);
 	struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane);
 
-	return hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
+	hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
+
+	return 0;
 }
 
 static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index c3a3e1e5fc8a..0ee084049555 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -200,9 +200,10 @@ int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor)
 	for (i = 0; i < nb_files; i++)
 		mixer_debugfs_files[i].data = mixer;
 
-	return drm_debugfs_create_files(mixer_debugfs_files,
-					nb_files,
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(mixer_debugfs_files,
+				 nb_files,
+				 minor->debugfs_root, minor);
+	return 0;
 }
 
 void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
index c36a8da373cb..df3817f0fd30 100644
--- a/drivers/gpu/drm/sti/sti_tvout.c
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -570,16 +570,16 @@ static struct drm_info_list tvout_debugfs_files[] = {
 	{ "tvout", tvout_dbg_show, 0, NULL },
 };
 
-static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
+static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(tvout_debugfs_files); i++)
 		tvout_debugfs_files[i].data = tvout;
 
-	return drm_debugfs_create_files(tvout_debugfs_files,
-					ARRAY_SIZE(tvout_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(tvout_debugfs_files,
+				 ARRAY_SIZE(tvout_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode)
@@ -603,14 +603,11 @@ static void sti_tvout_encoder_destroy(struct drm_encoder *encoder)
 static int sti_tvout_late_register(struct drm_encoder *encoder)
 {
 	struct sti_tvout *tvout = to_sti_tvout(encoder);
-	int ret;
 
 	if (tvout->debugfs_registered)
 		return 0;
 
-	ret = tvout_debugfs_init(tvout, encoder->dev->primary);
-	if (ret)
-		return ret;
+	tvout_debugfs_init(tvout, encoder->dev->primary);
 
 	tvout->debugfs_registered = true;
 	return 0;
diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
index 2d4230410464..2d818397918d 100644
--- a/drivers/gpu/drm/sti/sti_vid.c
+++ b/drivers/gpu/drm/sti/sti_vid.c
@@ -124,16 +124,16 @@ static struct drm_info_list vid_debugfs_files[] = {
 	{ "vid", vid_dbg_show, 0, NULL },
 };
 
-int vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
+void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(vid_debugfs_files); i++)
 		vid_debugfs_files[i].data = vid;
 
-	return drm_debugfs_create_files(vid_debugfs_files,
-					ARRAY_SIZE(vid_debugfs_files),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(vid_debugfs_files,
+				 ARRAY_SIZE(vid_debugfs_files),
+				 minor->debugfs_root, minor);
 }
 
 void sti_vid_commit(struct sti_vid *vid,
diff --git a/drivers/gpu/drm/sti/sti_vid.h b/drivers/gpu/drm/sti/sti_vid.h
index 9dbd78461de1..991849ba50b5 100644
--- a/drivers/gpu/drm/sti/sti_vid.h
+++ b/drivers/gpu/drm/sti/sti_vid.h
@@ -26,6 +26,6 @@ void sti_vid_disable(struct sti_vid *vid);
 struct sti_vid *sti_vid_create(struct device *dev, struct drm_device *drm_dev,
 			       int id, void __iomem *baseaddr);
 
-int vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor);
+void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor);
 
 #endif
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 16/21] drm/i915: make *_debugfs_register() functions return void.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (14 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 15/21] drm/sti: remove use drm_debugfs functions as return value Wambui Karuga
@ 2020-02-27 12:02 ` 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
                   ` (4 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi
  Cc: linux-kernel, gregkh, dri-devel, intel-gfx

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails and should return void. Therefore, remove its use as the
return value of i915_debugfs_register() and
intel_display_debugfs_register() and have both functions return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_display_debugfs.c | 8 ++++----
 drivers/gpu/drm/i915/display/intel_display_debugfs.h | 4 ++--
 drivers/gpu/drm/i915/i915_debugfs.c                  | 8 ++++----
 drivers/gpu/drm/i915/i915_debugfs.h                  | 4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 46954cc7b6c0..3b877c34c420 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -1922,7 +1922,7 @@ static const struct {
 	{"i915_edp_psr_debug", &i915_edp_psr_debug_fops},
 };
 
-int intel_display_debugfs_register(struct drm_i915_private *i915)
+void intel_display_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
 	int i;
@@ -1935,9 +1935,9 @@ int intel_display_debugfs_register(struct drm_i915_private *i915)
 				    intel_display_debugfs_files[i].fops);
 	}
 
-	return drm_debugfs_create_files(intel_display_debugfs_list,
-					ARRAY_SIZE(intel_display_debugfs_list),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(intel_display_debugfs_list,
+				 ARRAY_SIZE(intel_display_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 
 static int i915_panel_show(struct seq_file *m, void *data)
diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.h b/drivers/gpu/drm/i915/display/intel_display_debugfs.h
index a3bea1ce04c2..a5cf7a6d3d34 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.h
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.h
@@ -10,10 +10,10 @@ struct drm_connector;
 struct drm_i915_private;
 
 #ifdef CONFIG_DEBUG_FS
-int intel_display_debugfs_register(struct drm_i915_private *i915);
+void intel_display_debugfs_register(struct drm_i915_private *i915);
 int intel_connector_debugfs_add(struct drm_connector *connector);
 #else
-static inline int intel_display_debugfs_register(struct drm_i915_private *i915) { return 0; }
+static inline int intel_display_debugfs_register(struct drm_i915_private *i915) {}
 static inline int intel_connector_debugfs_add(struct drm_connector *connector) { return 0; }
 #endif
 
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 8f2525e4ce0f..de313199c714 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2392,7 +2392,7 @@ static const struct i915_debugfs_files {
 	{"i915_guc_log_relay", &i915_guc_log_relay_fops},
 };
 
-int i915_debugfs_register(struct drm_i915_private *dev_priv)
+void i915_debugfs_register(struct drm_i915_private *dev_priv)
 {
 	struct drm_minor *minor = dev_priv->drm.primary;
 	int i;
@@ -2409,7 +2409,7 @@ int i915_debugfs_register(struct drm_i915_private *dev_priv)
 				    i915_debugfs_files[i].fops);
 	}
 
-	return drm_debugfs_create_files(i915_debugfs_list,
-					I915_DEBUGFS_ENTRIES,
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(i915_debugfs_list,
+				 I915_DEBUGFS_ENTRIES,
+				 minor->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/i915/i915_debugfs.h b/drivers/gpu/drm/i915/i915_debugfs.h
index 6da39c76ab5e..1de2736f1248 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.h
+++ b/drivers/gpu/drm/i915/i915_debugfs.h
@@ -12,10 +12,10 @@ struct drm_i915_private;
 struct seq_file;
 
 #ifdef CONFIG_DEBUG_FS
-int i915_debugfs_register(struct drm_i915_private *dev_priv);
+void i915_debugfs_register(struct drm_i915_private *dev_priv);
 void i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj);
 #else
-static inline int i915_debugfs_register(struct drm_i915_private *dev_priv) { return 0; }
+static inline void i915_debugfs_register(struct drm_i915_private *dev_priv) {}
 static inline void i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) {}
 #endif
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 17/21] drm/tilcdc: remove check for return value of debugfs functions.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (15 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 16/21] drm/i915: make *_debugfs_register() functions return void Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:12   ` Jyri Sarha
  2020-02-27 12:02 ` [PATCH 18/21] drm/virtio: make virtio_gpu_debugfs() return void Wambui Karuga
                   ` (3 subsequent siblings)
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Jyri Sarha, Tomi Valkeinen
  Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
fails. Therefore, remove the check and error handling of the return
value of drm_debugfs_create_files() as it is not needed in
tilcdc_debugfs_init().

Also remove local variables that are not used after the changes, and
declare tilcdc_debugfs_init() as void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 0791a0200cc3..78c1877d13a8 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -478,26 +478,17 @@ static struct drm_info_list tilcdc_debugfs_list[] = {
 		{ "mm",   tilcdc_mm_show,   0 },
 };
 
-static int tilcdc_debugfs_init(struct drm_minor *minor)
+static void tilcdc_debugfs_init(struct drm_minor *minor)
 {
-	struct drm_device *dev = minor->dev;
 	struct tilcdc_module *mod;
-	int ret;
 
-	ret = drm_debugfs_create_files(tilcdc_debugfs_list,
-			ARRAY_SIZE(tilcdc_debugfs_list),
-			minor->debugfs_root, minor);
+	drm_debugfs_create_files(tilcdc_debugfs_list,
+				 ARRAY_SIZE(tilcdc_debugfs_list),
+				 minor->debugfs_root, minor);
 
 	list_for_each_entry(mod, &module_list, list)
 		if (mod->funcs->debugfs_init)
 			mod->funcs->debugfs_init(mod, minor);
-
-	if (ret) {
-		dev_err(dev->dev, "could not install tilcdc_debugfs_list\n");
-		return ret;
-	}
-
-	return ret;
 }
 #endif
 
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 18/21] drm/virtio: make virtio_gpu_debugfs() return void.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (16 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 17/21] drm/tilcdc: remove check for return value of debugfs functions Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 19/21] drm/mipi_dbi: make midi_dbi_debugfs_init() " Wambui Karuga
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Gerd Hoffmann; +Cc: linux-kernel, gregkh, dri-devel

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail), drm_debugfs_create_files()
never fails and should return void. Therefore, remove its use as the
return value of virtio_gpu_debugfs() and have the latter function return
void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/virtio/virtgpu_debugfs.c | 3 +--
 drivers/gpu/drm/virtio/virtgpu_drv.h     | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
index e27120d512b0..3221520f61f0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c
+++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
@@ -72,11 +72,10 @@ static struct drm_info_list virtio_gpu_debugfs_list[] = {
 
 #define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list)
 
-int
+void
 virtio_gpu_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(virtio_gpu_debugfs_list,
 				 VIRTIO_GPU_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);
-	return 0;
 }
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index 95a7443baaba..3b843bb72cd1 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -371,6 +371,6 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
 	struct sg_table *sgt);
 
 /* virgl debugfs */
-int virtio_gpu_debugfs_init(struct drm_minor *minor);
+void virtio_gpu_debugfs_init(struct drm_minor *minor);
 
 #endif
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 19/21] drm/mipi_dbi: make midi_dbi_debugfs_init() return void.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (17 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 18/21] drm/virtio: make virtio_gpu_debugfs() return void Wambui Karuga
@ 2020-02-27 12:02 ` 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
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann
  Cc: linux-kernel, gregkh, dri-devel

As midi_dbi_debugfs_init() never fails and does not return anything
other than zero, declare its return value as void.

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

diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
index 558baf989f5a..113a767442d3 100644
--- a/drivers/gpu/drm/drm_mipi_dbi.c
+++ b/drivers/gpu/drm/drm_mipi_dbi.c
@@ -1308,10 +1308,8 @@ static const struct file_operations mipi_dbi_debugfs_command_fops = {
  * controller or getting the read command values.
  * Drivers can use this as their &drm_driver->debugfs_init callback.
  *
- * Returns:
- * Zero on success, negative error code on failure.
  */
-int mipi_dbi_debugfs_init(struct drm_minor *minor)
+void mipi_dbi_debugfs_init(struct drm_minor *minor)
 {
 	struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(minor->dev);
 	umode_t mode = S_IFREG | S_IWUSR;
@@ -1320,8 +1318,6 @@ int mipi_dbi_debugfs_init(struct drm_minor *minor)
 		mode |= S_IRUGO;
 	debugfs_create_file("command", mode, minor->debugfs_root, dbidev,
 			    &mipi_dbi_debugfs_command_fops);
-
-	return 0;
 }
 EXPORT_SYMBOL(mipi_dbi_debugfs_init);
 
diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
index 33f325f5af2b..30ebdfd8a51f 100644
--- a/include/drm/drm_mipi_dbi.h
+++ b/include/drm/drm_mipi_dbi.h
@@ -192,7 +192,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
 })
 
 #ifdef CONFIG_DEBUG_FS
-int mipi_dbi_debugfs_init(struct drm_minor *minor);
+void mipi_dbi_debugfs_init(struct drm_minor *minor);
 #else
 #define mipi_dbi_debugfs_init		NULL
 #endif
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 20/21] drm/qxl: have debugfs functions return void.
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (18 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 19/21] drm/mipi_dbi: make midi_dbi_debugfs_init() " Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 12:02 ` [PATCH 21/21] drm/arm: have malidp_debufs_init() " Wambui Karuga
  20 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Gerd Hoffmann; +Cc: linux-kernel, gregkh, dri-devel

Due to the conversion of the .debugfs_init() hook to return void
(drm: convert the .debugfs_init() hook to return void), there
is no need for the return value of qxl_debugfs_init(). Therefore,
refactor the function to return void.

This change also includes the conversion of various functions that can
be converted to return void as a result of the changes to
qxl_debugfs_init().

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/qxl/qxl_debugfs.c | 21 +++++++--------------
 drivers/gpu/drm/qxl/qxl_drv.h     | 13 +++++--------
 drivers/gpu/drm/qxl/qxl_ttm.c     |  6 ++----
 3 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c
index a4f4175bbdbe..88123047fdd4 100644
--- a/drivers/gpu/drm/qxl/qxl_debugfs.c
+++ b/drivers/gpu/drm/qxl/qxl_debugfs.c
@@ -79,36 +79,30 @@ static struct drm_info_list qxl_debugfs_list[] = {
 #define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list)
 #endif
 
-int
+void
 qxl_debugfs_init(struct drm_minor *minor)
 {
 #if defined(CONFIG_DEBUG_FS)
-	int r;
 	struct qxl_device *dev =
 		(struct qxl_device *) minor->dev->dev_private;
 
 	drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);
 
-	r = qxl_ttm_debugfs_init(dev);
-	if (r) {
-		DRM_ERROR("Failed to init TTM debugfs\n");
-		return r;
-	}
+	qxl_ttm_debugfs_init(dev);
 #endif
-	return 0;
 }
 
-int qxl_debugfs_add_files(struct qxl_device *qdev,
-			  struct drm_info_list *files,
-			  unsigned int nfiles)
+void qxl_debugfs_add_files(struct qxl_device *qdev,
+			   struct drm_info_list *files,
+			   unsigned int nfiles)
 {
 	unsigned int i;
 
 	for (i = 0; i < qdev->debugfs_count; i++) {
 		if (qdev->debugfs[i].files == files) {
 			/* Already registered */
-			return 0;
+			return;
 		}
 	}
 
@@ -116,7 +110,7 @@ int qxl_debugfs_add_files(struct qxl_device *qdev,
 	if (i > QXL_DEBUGFS_MAX_COMPONENTS) {
 		DRM_ERROR("Reached maximum number of debugfs components.\n");
 		DRM_ERROR("Report so we increase QXL_DEBUGFS_MAX_COMPONENTS.\n");
-		return -EINVAL;
+		return;
 	}
 	qdev->debugfs[qdev->debugfs_count].files = files;
 	qdev->debugfs[qdev->debugfs_count].num_files = nfiles;
@@ -126,5 +120,4 @@ int qxl_debugfs_add_files(struct qxl_device *qdev,
 				 qdev->ddev.primary->debugfs_root,
 				 qdev->ddev.primary);
 #endif
-	return 0;
 }
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
index 27e45a2d6b52..435126facc9b 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.h
+++ b/drivers/gpu/drm/qxl/qxl_drv.h
@@ -190,9 +190,6 @@ struct qxl_debugfs {
 	unsigned int num_files;
 };
 
-int qxl_debugfs_add_files(struct qxl_device *rdev,
-			     struct drm_info_list *files,
-			     unsigned int nfiles);
 int qxl_debugfs_fence_init(struct qxl_device *rdev);
 
 struct qxl_device;
@@ -442,8 +439,8 @@ int qxl_garbage_collect(struct qxl_device *qdev);
 
 /* debugfs */
 
-int qxl_debugfs_init(struct drm_minor *minor);
-int qxl_ttm_debugfs_init(struct qxl_device *qdev);
+void qxl_debugfs_init(struct drm_minor *minor);
+void qxl_ttm_debugfs_init(struct qxl_device *qdev);
 
 /* qxl_prime.c */
 int qxl_gem_prime_pin(struct drm_gem_object *obj);
@@ -461,9 +458,9 @@ int qxl_gem_prime_mmap(struct drm_gem_object *obj,
 int qxl_irq_init(struct qxl_device *qdev);
 irqreturn_t qxl_irq_handler(int irq, void *arg);
 
-int qxl_debugfs_add_files(struct qxl_device *qdev,
-			  struct drm_info_list *files,
-			  unsigned int nfiles);
+void qxl_debugfs_add_files(struct qxl_device *qdev,
+			   struct drm_info_list *files,
+			   unsigned int nfiles);
 
 int qxl_surface_id_alloc(struct qxl_device *qdev,
 			 struct qxl_bo *surf);
diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 62a5e424971b..93a2eb14844b 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -322,7 +322,7 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data)
 }
 #endif
 
-int qxl_ttm_debugfs_init(struct qxl_device *qdev)
+void qxl_ttm_debugfs_init(struct qxl_device *qdev)
 {
 #if defined(CONFIG_DEBUG_FS)
 	static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES];
@@ -343,8 +343,6 @@ int qxl_ttm_debugfs_init(struct qxl_device *qdev)
 			qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV].priv;
 
 	}
-	return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);
-#else
-	return 0;
+	qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);
 #endif
 }
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 21/21] drm/arm: have malidp_debufs_init() return void
  2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
                   ` (19 preceding siblings ...)
  2020-02-27 12:02 ` [PATCH 20/21] drm/qxl: have debugfs functions " Wambui Karuga
@ 2020-02-27 12:02 ` Wambui Karuga
  2020-02-27 14:53   ` Liviu Dudau
  20 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel, airlied, Liviu Dudau, Brian Starkey
  Cc: linux-kernel, gregkh, dri-devel

As there's no need for the return value in malidp_debugfs_init() after
the conversion of the drm_driver.debugfs_init() hook, (drm: convert the
.debugs_init() hook to return void), convert the malidp_debugfs_init()
function to return void.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/arm/malidp_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 37d92a06318e..def8c9ffafca 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -548,7 +548,7 @@ static const struct file_operations malidp_debugfs_fops = {
 	.release = single_release,
 };
 
-static int malidp_debugfs_init(struct drm_minor *minor)
+static void malidp_debugfs_init(struct drm_minor *minor)
 {
 	struct malidp_drm *malidp = minor->dev->dev_private;
 
@@ -557,7 +557,6 @@ static int malidp_debugfs_init(struct drm_minor *minor)
 	spin_lock_init(&malidp->errors_lock);
 	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root,
 			    minor->dev, &malidp_debugfs_fops);
-	return 0;
 }
 
 #endif //CONFIG_DEBUG_FS
-- 
2.25.0


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 17/21] drm/tilcdc: remove check for return value of debugfs functions.
  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
  0 siblings, 1 reply; 40+ messages in thread
From: Jyri Sarha @ 2020-02-27 12:12 UTC (permalink / raw)
  To: Wambui Karuga, daniel, airlied, Tomi Valkeinen
  Cc: linux-kernel, gregkh, dri-devel, Valkeinen, Tomi

On 27/02/2020 14:02, Wambui Karuga wrote:
> Since 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
> fails. Therefore, remove the check and error handling of the return
> value of drm_debugfs_create_files() as it is not needed in
> tilcdc_debugfs_init().
> 
> Also remove local variables that are not used after the changes, and
> declare tilcdc_debugfs_init() as void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>


Ok, so this is a part of a bigger series.

Acked-by: Jyri Sarha <jsarha@ti.com>

I assume the series will be merged as one without my involvement. Please
let me know if that is not the case.

BR,
Jyri

> ---
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index 0791a0200cc3..78c1877d13a8 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -478,26 +478,17 @@ static struct drm_info_list tilcdc_debugfs_list[] = {
>  		{ "mm",   tilcdc_mm_show,   0 },
>  };
>  
> -static int tilcdc_debugfs_init(struct drm_minor *minor)
> +static void tilcdc_debugfs_init(struct drm_minor *minor)
>  {
> -	struct drm_device *dev = minor->dev;
>  	struct tilcdc_module *mod;
> -	int ret;
>  
> -	ret = drm_debugfs_create_files(tilcdc_debugfs_list,
> -			ARRAY_SIZE(tilcdc_debugfs_list),
> -			minor->debugfs_root, minor);
> +	drm_debugfs_create_files(tilcdc_debugfs_list,
> +				 ARRAY_SIZE(tilcdc_debugfs_list),
> +				 minor->debugfs_root, minor);
>  
>  	list_for_each_entry(mod, &module_list, list)
>  		if (mod->funcs->debugfs_init)
>  			mod->funcs->debugfs_init(mod, minor);
> -
> -	if (ret) {
> -		dev_err(dev->dev, "could not install tilcdc_debugfs_list\n");
> -		return ret;
> -	}
> -
> -	return ret;
>  }
>  #endif
>  
> 


-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 02/21] drm: convert the drm_driver.debugfs_init() hook to return void.
  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
  0 siblings, 1 reply; 40+ messages in thread
From: Greg KH @ 2020-02-27 12:23 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, mripard, maarten.lankhorst, tzimmermann,
	linux-kernel, dri-devel

On Thu, Feb 27, 2020 at 03:02:13PM +0300, Wambui Karuga wrote:
> As a result of commit 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail) and changes to various debugfs
> functions in drm/core and across various drivers, there is no need for
> the drm_driver.debugfs_init() hook to have a return value. Therefore,
> declare it as void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> ---
>  include/drm/drm_drv.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index 97109df5beac..c6ae888c672b 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -323,7 +323,7 @@ struct drm_driver {
>  	 *
>  	 * Allows drivers to create driver-specific debugfs files.
>  	 */
> -	int (*debugfs_init)(struct drm_minor *minor);
> +	void (*debugfs_init)(struct drm_minor *minor);


Doesn't this patch break the build, or at least, cause lots of build
warnings to happen?

Fixing it all up later is good, but I don't think you want to break
things at this point in the series.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 17/21] drm/tilcdc: remove check for return value of debugfs functions.
  2020-02-27 12:12   ` Jyri Sarha
@ 2020-02-27 12:23     ` Wambui Karuga
  0 siblings, 0 replies; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:23 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: Wambui Karuga, daniel, airlied, Tomi Valkeinen, linux-kernel,
	gregkh, dri-devel



On Thu, 27 Feb 2020, Jyri Sarha wrote:

> On 27/02/2020 14:02, Wambui Karuga wrote:
>> Since 987d65d01356 (drm: debugfs: make
>> drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
>> fails. Therefore, remove the check and error handling of the return
>> value of drm_debugfs_create_files() as it is not needed in
>> tilcdc_debugfs_init().
>>
>> Also remove local variables that are not used after the changes, and
>> declare tilcdc_debugfs_init() as void.
>>
>> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
>
>
> Ok, so this is a part of a bigger series.
>
Yes, this was converted to a series after initial feedback. Thanks for 
your review

wambui karuga.
> Acked-by: Jyri Sarha <jsarha@ti.com>
>
> I assume the series will be merged as one without my involvement. Please
> let me know if that is not the case.
>
> BR,
> Jyri
>
>> ---
>>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 17 ++++-------------
>>  1 file changed, 4 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> index 0791a0200cc3..78c1877d13a8 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> @@ -478,26 +478,17 @@ static struct drm_info_list tilcdc_debugfs_list[] = {
>>  		{ "mm",   tilcdc_mm_show,   0 },
>>  };
>>
>> -static int tilcdc_debugfs_init(struct drm_minor *minor)
>> +static void tilcdc_debugfs_init(struct drm_minor *minor)
>>  {
>> -	struct drm_device *dev = minor->dev;
>>  	struct tilcdc_module *mod;
>> -	int ret;
>>
>> -	ret = drm_debugfs_create_files(tilcdc_debugfs_list,
>> -			ARRAY_SIZE(tilcdc_debugfs_list),
>> -			minor->debugfs_root, minor);
>> +	drm_debugfs_create_files(tilcdc_debugfs_list,
>> +				 ARRAY_SIZE(tilcdc_debugfs_list),
>> +				 minor->debugfs_root, minor);
>>
>>  	list_for_each_entry(mod, &module_list, list)
>>  		if (mod->funcs->debugfs_init)
>>  			mod->funcs->debugfs_init(mod, minor);
>> -
>> -	if (ret) {
>> -		dev_err(dev->dev, "could not install tilcdc_debugfs_list\n");
>> -		return ret;
>> -	}
>> -
>> -	return ret;
>>  }
>>  #endif
>>
>>
>
>
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 02/21] drm: convert the drm_driver.debugfs_init() hook to return void.
  2020-02-27 12:23   ` Greg KH
@ 2020-02-27 12:29     ` Wambui Karuga
  2020-02-27 12:34       ` Greg KH
  0 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:29 UTC (permalink / raw)
  To: Greg KH
  Cc: Wambui Karuga, daniel, airlied, mripard, maarten.lankhorst,
	tzimmermann, linux-kernel, dri-devel



On Thu, 27 Feb 2020, Greg KH wrote:

> On Thu, Feb 27, 2020 at 03:02:13PM +0300, Wambui Karuga wrote:
>> As a result of commit 987d65d01356 (drm: debugfs: make
>> drm_debugfs_create_files() never fail) and changes to various debugfs
>> functions in drm/core and across various drivers, there is no need for
>> the drm_driver.debugfs_init() hook to have a return value. Therefore,
>> declare it as void.
>>
>> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
>> ---
>>  include/drm/drm_drv.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
>> index 97109df5beac..c6ae888c672b 100644
>> --- a/include/drm/drm_drv.h
>> +++ b/include/drm/drm_drv.h
>> @@ -323,7 +323,7 @@ struct drm_driver {
>>  	 *
>>  	 * Allows drivers to create driver-specific debugfs files.
>>  	 */
>> -	int (*debugfs_init)(struct drm_minor *minor);
>> +	void (*debugfs_init)(struct drm_minor *minor);
>
>
> Doesn't this patch break the build, or at least, cause lots of build
> warnings to happen?
>
> Fixing it all up later is good, but I don't think you want to break
> things at this point in the series.
>
So, should it come last in the series? All functions that use this hook 
have been converted to void in the patchset.

thanks,
wambui karuga

> thanks,
>
> greg k-h
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 02/21] drm: convert the drm_driver.debugfs_init() hook to return void.
  2020-02-27 12:29     ` Wambui Karuga
@ 2020-02-27 12:34       ` Greg KH
  0 siblings, 0 replies; 40+ messages in thread
From: Greg KH @ 2020-02-27 12:34 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, mripard, maarten.lankhorst, tzimmermann,
	linux-kernel, dri-devel

On Thu, Feb 27, 2020 at 03:29:46PM +0300, Wambui Karuga wrote:
> 
> 
> On Thu, 27 Feb 2020, Greg KH wrote:
> 
> > On Thu, Feb 27, 2020 at 03:02:13PM +0300, Wambui Karuga wrote:
> > > As a result of commit 987d65d01356 (drm: debugfs: make
> > > drm_debugfs_create_files() never fail) and changes to various debugfs
> > > functions in drm/core and across various drivers, there is no need for
> > > the drm_driver.debugfs_init() hook to have a return value. Therefore,
> > > declare it as void.
> > > 
> > > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> > > ---
> > >  include/drm/drm_drv.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> > > index 97109df5beac..c6ae888c672b 100644
> > > --- a/include/drm/drm_drv.h
> > > +++ b/include/drm/drm_drv.h
> > > @@ -323,7 +323,7 @@ struct drm_driver {
> > >  	 *
> > >  	 * Allows drivers to create driver-specific debugfs files.
> > >  	 */
> > > -	int (*debugfs_init)(struct drm_minor *minor);
> > > +	void (*debugfs_init)(struct drm_minor *minor);
> > 
> > 
> > Doesn't this patch break the build, or at least, cause lots of build
> > warnings to happen?
> > 
> > Fixing it all up later is good, but I don't think you want to break
> > things at this point in the series.
> > 
> So, should it come last in the series? All functions that use this hook have
> been converted to void in the patchset.

I recommend fixing up the functions to just always return 0 first, and
then in one last patch, change the function itself to return void along
with this.

That would make it easiest to review, and allow no build warnings at any
point in the series, right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 16/21] drm/i915: make *_debugfs_register() functions return void.
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Jani Nikula @ 2020-02-27 13:08 UTC (permalink / raw)
  To: Wambui Karuga, daniel, airlied, Joonas Lahtinen, Rodrigo Vivi
  Cc: linux-kernel, gregkh, dri-devel, intel-gfx

On Thu, 27 Feb 2020, Wambui Karuga <wambui.karugax@gmail.com> wrote:
> Since 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
> fails and should return void. Therefore, remove its use as the
> return value of i915_debugfs_register() and
> intel_display_debugfs_register() and have both functions return void.
>
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_debugfs.c | 8 ++++----
>  drivers/gpu/drm/i915/display/intel_display_debugfs.h | 4 ++--
>  drivers/gpu/drm/i915/i915_debugfs.c                  | 8 ++++----
>  drivers/gpu/drm/i915/i915_debugfs.h                  | 4 ++--
>  4 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 46954cc7b6c0..3b877c34c420 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1922,7 +1922,7 @@ static const struct {
>  	{"i915_edp_psr_debug", &i915_edp_psr_debug_fops},
>  };
>  
> -int intel_display_debugfs_register(struct drm_i915_private *i915)
> +void intel_display_debugfs_register(struct drm_i915_private *i915)
>  {
>  	struct drm_minor *minor = i915->drm.primary;
>  	int i;
> @@ -1935,9 +1935,9 @@ int intel_display_debugfs_register(struct drm_i915_private *i915)
>  				    intel_display_debugfs_files[i].fops);
>  	}
>  
> -	return drm_debugfs_create_files(intel_display_debugfs_list,
> -					ARRAY_SIZE(intel_display_debugfs_list),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(intel_display_debugfs_list,
> +				 ARRAY_SIZE(intel_display_debugfs_list),
> +				 minor->debugfs_root, minor);
>  }
>  
>  static int i915_panel_show(struct seq_file *m, void *data)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.h b/drivers/gpu/drm/i915/display/intel_display_debugfs.h
> index a3bea1ce04c2..a5cf7a6d3d34 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.h
> @@ -10,10 +10,10 @@ struct drm_connector;
>  struct drm_i915_private;
>  
>  #ifdef CONFIG_DEBUG_FS
> -int intel_display_debugfs_register(struct drm_i915_private *i915);
> +void intel_display_debugfs_register(struct drm_i915_private *i915);
>  int intel_connector_debugfs_add(struct drm_connector *connector);
>  #else
> -static inline int intel_display_debugfs_register(struct drm_i915_private *i915) { return 0; }
> +static inline int intel_display_debugfs_register(struct drm_i915_private *i915) {}

You don't actually change the return type.

Otherwise, LGTM.

BR,
Jani.

>  static inline int intel_connector_debugfs_add(struct drm_connector *connector) { return 0; }
>  #endif
>  
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 8f2525e4ce0f..de313199c714 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2392,7 +2392,7 @@ static const struct i915_debugfs_files {
>  	{"i915_guc_log_relay", &i915_guc_log_relay_fops},
>  };
>  
> -int i915_debugfs_register(struct drm_i915_private *dev_priv)
> +void i915_debugfs_register(struct drm_i915_private *dev_priv)
>  {
>  	struct drm_minor *minor = dev_priv->drm.primary;
>  	int i;
> @@ -2409,7 +2409,7 @@ int i915_debugfs_register(struct drm_i915_private *dev_priv)
>  				    i915_debugfs_files[i].fops);
>  	}
>  
> -	return drm_debugfs_create_files(i915_debugfs_list,
> -					I915_DEBUGFS_ENTRIES,
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(i915_debugfs_list,
> +				 I915_DEBUGFS_ENTRIES,
> +				 minor->debugfs_root, minor);
>  }
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.h b/drivers/gpu/drm/i915/i915_debugfs.h
> index 6da39c76ab5e..1de2736f1248 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.h
> +++ b/drivers/gpu/drm/i915/i915_debugfs.h
> @@ -12,10 +12,10 @@ struct drm_i915_private;
>  struct seq_file;
>  
>  #ifdef CONFIG_DEBUG_FS
> -int i915_debugfs_register(struct drm_i915_private *dev_priv);
> +void i915_debugfs_register(struct drm_i915_private *dev_priv);
>  void i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj);
>  #else
> -static inline int i915_debugfs_register(struct drm_i915_private *dev_priv) { return 0; }
> +static inline void i915_debugfs_register(struct drm_i915_private *dev_priv) {}
>  static inline void i915_debugfs_describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) {}
>  #endif

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 08/21] drm/etnaviv: remove check for return value of drm_debugfs function
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Lucas Stach @ 2020-02-27 13:36 UTC (permalink / raw)
  To: Wambui Karuga, daniel, airlied, Russell King, Christian Gmeiner
  Cc: linux-kernel, gregkh, etnaviv, dri-devel

On Do, 2020-02-27 at 15:02 +0300, Wambui Karuga wrote:
> Since commit 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_file only
> returns 0, and there is no need to check the return value.
> This change therefore removes the check and error handling in
> etnaviv_debugfs_init() and also makes the function return void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_drv.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index 6b43c1c94e8f..a39735316ca5 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -231,21 +231,11 @@ static struct drm_info_list etnaviv_debugfs_list[] = {
>  		{"ring", show_each_gpu, 0, etnaviv_ring_show},
>  };
>  
> -static int etnaviv_debugfs_init(struct drm_minor *minor)
> +static void etnaviv_debugfs_init(struct drm_minor *minor)
>  {
> -	struct drm_device *dev = minor->dev;
> -	int ret;
> -
> -	ret = drm_debugfs_create_files(etnaviv_debugfs_list,
> -			ARRAY_SIZE(etnaviv_debugfs_list),
> -			minor->debugfs_root, minor);
> -
> -	if (ret) {
> -		dev_err(dev->dev, "could not install etnaviv_debugfs_list\n");
> -		return ret;
> -	}
> -
> -	return ret;
> +	drm_debugfs_create_files(etnaviv_debugfs_list,
> +				 ARRAY_SIZE(etnaviv_debugfs_list),
> +				 minor->debugfs_root, minor);
>  }
>  #endif
>  


^ permalink raw reply	[flat|nested] 40+ messages in thread

* RE: [PATCH 06/21] drm/arc: make arcpgu_debugfs_init return void
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Alexey Brodkin @ 2020-02-27 14:43 UTC (permalink / raw)
  To: Wambui Karuga; +Cc: linux-kernel, gregkh, dri-devel, daniel, airlied

Hi Wambui,

> -----Original Message-----
> From: Wambui Karuga <wambui.karugax@gmail.com>
> Sent: Thursday, February 27, 2020 7:02 PM
> To: daniel@ffwll.ch; airlied@linux.ie; Alexey Brodkin <abrodkin@synopsys.com>
> Cc: linux-kernel@vger.kernel.org; gregkh@linuxfoundation.org; dri-devel@lists.freedesktop.org
> Subject: [PATCH 06/21] drm/arc: make arcpgu_debugfs_init return void
> 
> Since commit 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files never
> fails and should return void. Therefore, remove its use as the
> return value of arcpgu_debugfs_init and have the latter function also
> return void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Thanks for this clean-up and

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 12/21] drm/msm: remove checks for return value of drm_debugfs functions.
  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
  1 sibling, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2020-02-27 14:45 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, Rob Clark, Sean Paul, linux-kernel, gregkh,
	dri-devel, linux-arm-msm, freedreno

On Thu, Feb 27, 2020 at 03:02:23PM +0300, Wambui Karuga wrote:
> Since commit 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files() does
> not fail, and should return void. This change therefore removes the
> checks of its return value in drm/msm and subsequent error handling.
> 
> These changes also enable the changing of various debugfs_init()
> functions to return void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

I think msm_kms_funcs->debugfs_init could also be made to return void. But
that's quite a bit more involved so doesn't make much sense to do that as
part of this patch series.

Also the debug/core_perf/ files look kinda funny, if I'd bet this is used
by the qualcomm hwc somewhere to make it's decisions :-) That's at least
what's been the case everywhere else I spotted something like that.
-Daniel

> ---
>  drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 18 +++++-------------
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c  | 14 +++-----------
>  drivers/gpu/drm/msm/msm_debugfs.c         | 21 ++++++---------------
>  drivers/gpu/drm/msm/msm_debugfs.h         |  2 +-
>  drivers/gpu/drm/msm/msm_gpu.h             |  2 +-
>  5 files changed, 16 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> index 075ecce4b5e0..8cae2ca4af6b 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> @@ -148,27 +148,19 @@ reset_set(void *data, u64 val)
>  DEFINE_SIMPLE_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n");
>  
>  
> -int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
> +void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
>  {
>  	struct drm_device *dev;
> -	int ret;
>  
>  	if (!minor)
> -		return 0;
> +		return;
>  
>  	dev = minor->dev;
>  
> -	ret = drm_debugfs_create_files(a5xx_debugfs_list,
> -			ARRAY_SIZE(a5xx_debugfs_list),
> -			minor->debugfs_root, minor);
> -
> -	if (ret) {
> -		DRM_DEV_ERROR(dev->dev, "could not install a5xx_debugfs_list\n");
> -		return ret;
> -	}
> +	drm_debugfs_create_files(a5xx_debugfs_list,
> +				 ARRAY_SIZE(a5xx_debugfs_list),
> +				 minor->debugfs_root, minor);
>  
>  	debugfs_create_file("reset", S_IWUGO, minor->debugfs_root, dev,
>  			    &reset_fops);
> -
> -	return 0;
>  }
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> index 6650f478b226..41b461128bbc 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> @@ -259,17 +259,9 @@ static struct drm_info_list mdp5_debugfs_list[] = {
>  
>  static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
>  {
> -	struct drm_device *dev = minor->dev;
> -	int ret;
> -
> -	ret = drm_debugfs_create_files(mdp5_debugfs_list,
> -			ARRAY_SIZE(mdp5_debugfs_list),
> -			minor->debugfs_root, minor);
> -
> -	if (ret) {
> -		DRM_DEV_ERROR(dev->dev, "could not install mdp5_debugfs_list\n");
> -		return ret;
> -	}
> +	drm_debugfs_create_files(mdp5_debugfs_list,
> +				 ARRAY_SIZE(mdp5_debugfs_list),
> +				 minor->debugfs_root, minor);
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
> index 1c74381a4fc9..3c958f311bbc 100644
> --- a/drivers/gpu/drm/msm/msm_debugfs.c
> +++ b/drivers/gpu/drm/msm/msm_debugfs.c
> @@ -214,31 +214,22 @@ int msm_debugfs_late_init(struct drm_device *dev)
>  	return ret;
>  }
>  
> -int msm_debugfs_init(struct drm_minor *minor)
> +void msm_debugfs_init(struct drm_minor *minor)
>  {
>  	struct drm_device *dev = minor->dev;
>  	struct msm_drm_private *priv = dev->dev_private;
> -	int ret;
> +	int ret = 0;
>  
> -	ret = drm_debugfs_create_files(msm_debugfs_list,
> -			ARRAY_SIZE(msm_debugfs_list),
> -			minor->debugfs_root, minor);
> -
> -	if (ret) {
> -		DRM_DEV_ERROR(dev->dev, "could not install msm_debugfs_list\n");
> -		return ret;
> -	}
> +	drm_debugfs_create_files(msm_debugfs_list,
> +				 ARRAY_SIZE(msm_debugfs_list),
> +				 minor->debugfs_root, minor);
>  
>  	debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root,
>  		dev, &msm_gpu_fops);
>  
>  	if (priv->kms && priv->kms->funcs->debugfs_init) {
> -		ret = priv->kms->funcs->debugfs_init(priv->kms, minor);
> -		if (ret)
> -			return ret;
> +		priv->kms->funcs->debugfs_init(priv->kms, minor);
>  	}
> -
> -	return ret;
>  }
>  #endif
>  
> diff --git a/drivers/gpu/drm/msm/msm_debugfs.h b/drivers/gpu/drm/msm/msm_debugfs.h
> index 2b91f8c178ad..ef58f66abbb3 100644
> --- a/drivers/gpu/drm/msm/msm_debugfs.h
> +++ b/drivers/gpu/drm/msm/msm_debugfs.h
> @@ -8,7 +8,7 @@
>  #define __MSM_DEBUGFS_H__
>  
>  #ifdef CONFIG_DEBUG_FS
> -int msm_debugfs_init(struct drm_minor *minor);
> +void msm_debugfs_init(struct drm_minor *minor);
>  #endif
>  
>  #endif /* __MSM_DEBUGFS_H__ */
> diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
> index be5bc2e8425c..6ccae4ba905c 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.h
> +++ b/drivers/gpu/drm/msm/msm_gpu.h
> @@ -57,7 +57,7 @@ struct msm_gpu_funcs {
>  	void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
>  			struct drm_printer *p);
>  	/* for generation specific debugfs: */
> -	int (*debugfs_init)(struct msm_gpu *gpu, struct drm_minor *minor);
> +	void (*debugfs_init)(struct msm_gpu *gpu, struct drm_minor *minor);
>  #endif
>  	unsigned long (*gpu_busy)(struct msm_gpu *gpu);
>  	struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu);
> -- 
> 2.25.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 15/21] drm/sti: remove use drm_debugfs functions as return value
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2020-02-27 14:51 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, Benjamin Gaignard, Vincent Abriou, linux-kernel,
	gregkh, dri-devel

On Thu, Feb 27, 2020 at 03:02:26PM +0300, Wambui Karuga wrote:
> Since commit 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
> fails, and should return void. This change therefore removes it uses as
> a return value in various functions across drm/sti.
> 
> With these changes, the affected functions have been changed to use a void
> return value.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> ---
>  drivers/gpu/drm/sti/sti_cursor.c | 14 ++++++++------
>  drivers/gpu/drm/sti/sti_drv.c    | 16 ++++------------
>  drivers/gpu/drm/sti/sti_dvo.c    | 13 +++++--------
>  drivers/gpu/drm/sti/sti_gdp.c    |  7 ++++---
>  drivers/gpu/drm/sti/sti_hda.c    | 13 +++++--------
>  drivers/gpu/drm/sti/sti_hdmi.c   | 13 +++++--------
>  drivers/gpu/drm/sti/sti_hqvdp.c  | 12 +++++++-----
>  drivers/gpu/drm/sti/sti_mixer.c  |  7 ++++---
>  drivers/gpu/drm/sti/sti_tvout.c  | 13 +++++--------
>  drivers/gpu/drm/sti/sti_vid.c    |  8 ++++----
>  drivers/gpu/drm/sti/sti_vid.h    |  2 +-
>  11 files changed, 52 insertions(+), 66 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
> index ea64c1dcaf63..a98057431023 100644
> --- a/drivers/gpu/drm/sti/sti_cursor.c
> +++ b/drivers/gpu/drm/sti/sti_cursor.c
> @@ -131,17 +131,17 @@ static struct drm_info_list cursor_debugfs_files[] = {
>  	{ "cursor", cursor_dbg_show, 0, NULL },
>  };
>  
> -static int cursor_debugfs_init(struct sti_cursor *cursor,
> -			       struct drm_minor *minor)
> +static void cursor_debugfs_init(struct sti_cursor *cursor,
> +				struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(cursor_debugfs_files); i++)
>  		cursor_debugfs_files[i].data = cursor;
>  
> -	return drm_debugfs_create_files(cursor_debugfs_files,
> -					ARRAY_SIZE(cursor_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(cursor_debugfs_files,
> +				 ARRAY_SIZE(cursor_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src)
> @@ -342,7 +342,9 @@ static int sti_cursor_late_register(struct drm_plane *drm_plane)
>  	struct sti_plane *plane = to_sti_plane(drm_plane);
>  	struct sti_cursor *cursor = to_sti_cursor(plane);
>  
> -	return cursor_debugfs_init(cursor, drm_plane->dev->primary);
> +	cursor_debugfs_init(cursor, drm_plane->dev->primary);
> +
> +	return 0;
>  }
>  
>  static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = {
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 50870d8cbb76..3f9db3e3f397 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -92,24 +92,16 @@ static struct drm_info_list sti_drm_dbg_list[] = {
>  	{"fps_get", sti_drm_fps_dbg_show, 0},
>  };
>  
> -static int sti_drm_dbg_init(struct drm_minor *minor)
> +static void sti_drm_dbg_init(struct drm_minor *minor)
>  {
> -	int ret;
> -
> -	ret = drm_debugfs_create_files(sti_drm_dbg_list,
> -				       ARRAY_SIZE(sti_drm_dbg_list),
> -				       minor->debugfs_root, minor);
> -	if (ret)
> -		goto err;
> +	drm_debugfs_create_files(sti_drm_dbg_list,
> +				 ARRAY_SIZE(sti_drm_dbg_list),
> +				 minor->debugfs_root, minor);
>  
>  	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root,
>  			    minor->dev, &sti_drm_fps_fops);
>  
>  	DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
> -	return 0;
> -err:
> -	DRM_ERROR("%s: cannot install debugfs\n", DRIVER_NAME);
> -	return ret;
>  }
>  
>  static const struct drm_mode_config_funcs sti_mode_config_funcs = {
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index a0709647f678..0032e1830bc5 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -197,16 +197,16 @@ static struct drm_info_list dvo_debugfs_files[] = {
>  	{ "dvo", dvo_dbg_show, 0, NULL },
>  };
>  
> -static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
> +static void dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(dvo_debugfs_files); i++)
>  		dvo_debugfs_files[i].data = dvo;
>  
> -	return drm_debugfs_create_files(dvo_debugfs_files,
> -					ARRAY_SIZE(dvo_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(dvo_debugfs_files,
> +				 ARRAY_SIZE(dvo_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  static void sti_dvo_disable(struct drm_bridge *bridge)
> @@ -406,10 +406,7 @@ static int sti_dvo_late_register(struct drm_connector *connector)
>  		= to_sti_dvo_connector(connector);
>  	struct sti_dvo *dvo = dvo_connector->dvo;
>  
> -	if (dvo_debugfs_init(dvo, dvo->drm_dev->primary)) {
> -		DRM_ERROR("DVO debugfs setup failed\n");
> -		return -EINVAL;
> -	}
> +	dvo_debugfs_init(dvo, dvo->drm_dev->primary);
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 11595c748844..2d5a2b5b78b8 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -343,9 +343,10 @@ static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor)
>  	for (i = 0; i < nb_files; i++)
>  		gdp_debugfs_files[i].data = gdp;
>  
> -	return drm_debugfs_create_files(gdp_debugfs_files,
> -					nb_files,
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(gdp_debugfs_files,
> +				 nb_files,
> +				 minor->debugfs_root, minor);
> +	return 0;
>  }
>  
>  static int sti_gdp_fourcc2format(int fourcc)
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index f3f28d79b0e4..a1ec891eaf3a 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -367,16 +367,16 @@ static struct drm_info_list hda_debugfs_files[] = {
>  	{ "hda", hda_dbg_show, 0, NULL },
>  };
>  
> -static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
> +static void hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(hda_debugfs_files); i++)
>  		hda_debugfs_files[i].data = hda;
>  
> -	return drm_debugfs_create_files(hda_debugfs_files,
> -					ARRAY_SIZE(hda_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(hda_debugfs_files,
> +				 ARRAY_SIZE(hda_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  /**
> @@ -643,10 +643,7 @@ static int sti_hda_late_register(struct drm_connector *connector)
>  		= to_sti_hda_connector(connector);
>  	struct sti_hda *hda = hda_connector->hda;
>  
> -	if (hda_debugfs_init(hda, hda->drm_dev->primary)) {
> -		DRM_ERROR("HDA debugfs setup failed\n");
> -		return -EINVAL;
> -	}
> +	hda_debugfs_init(hda, hda->drm_dev->primary);
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 18eaf786ffa4..5b15c4974e6b 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -727,16 +727,16 @@ static struct drm_info_list hdmi_debugfs_files[] = {
>  	{ "hdmi", hdmi_dbg_show, 0, NULL },
>  };
>  
> -static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
> +static void hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(hdmi_debugfs_files); i++)
>  		hdmi_debugfs_files[i].data = hdmi;
>  
> -	return drm_debugfs_create_files(hdmi_debugfs_files,
> -					ARRAY_SIZE(hdmi_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(hdmi_debugfs_files,
> +				 ARRAY_SIZE(hdmi_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  static void sti_hdmi_disable(struct drm_bridge *bridge)
> @@ -1113,10 +1113,7 @@ static int sti_hdmi_late_register(struct drm_connector *connector)
>  		= to_sti_hdmi_connector(connector);
>  	struct sti_hdmi *hdmi = hdmi_connector->hdmi;
>  
> -	if (hdmi_debugfs_init(hdmi, hdmi->drm_dev->primary)) {
> -		DRM_ERROR("HDMI debugfs setup failed\n");
> -		return -EINVAL;
> -	}
> +	hdmi_debugfs_init(hdmi, hdmi->drm_dev->primary);
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 1015abe0ce08..5a4e12194a77 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -639,16 +639,16 @@ static struct drm_info_list hqvdp_debugfs_files[] = {
>  	{ "hqvdp", hqvdp_dbg_show, 0, NULL },
>  };
>  
> -static int hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor)
> +static void hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(hqvdp_debugfs_files); i++)
>  		hqvdp_debugfs_files[i].data = hqvdp;
>  
> -	return drm_debugfs_create_files(hqvdp_debugfs_files,
> -					ARRAY_SIZE(hqvdp_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(hqvdp_debugfs_files,
> +				 ARRAY_SIZE(hqvdp_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  /**
> @@ -1274,7 +1274,9 @@ static int sti_hqvdp_late_register(struct drm_plane *drm_plane)
>  	struct sti_plane *plane = to_sti_plane(drm_plane);
>  	struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane);
>  
> -	return hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
> +	hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
> +
> +	return 0;
>  }
>  
>  static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
> diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
> index c3a3e1e5fc8a..0ee084049555 100644
> --- a/drivers/gpu/drm/sti/sti_mixer.c
> +++ b/drivers/gpu/drm/sti/sti_mixer.c
> @@ -200,9 +200,10 @@ int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor)

I think sti_mixer_debugfs_init can also be made to return void, and then
sti_compositor_debugfs_init can also be converted void return value.

Otherwise I think looks good.
-Daniel

>  	for (i = 0; i < nb_files; i++)
>  		mixer_debugfs_files[i].data = mixer;
>  
> -	return drm_debugfs_create_files(mixer_debugfs_files,
> -					nb_files,
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(mixer_debugfs_files,
> +				 nb_files,
> +				 minor->debugfs_root, minor);
> +	return 0;
>  }
>  
>  void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> index c36a8da373cb..df3817f0fd30 100644
> --- a/drivers/gpu/drm/sti/sti_tvout.c
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -570,16 +570,16 @@ static struct drm_info_list tvout_debugfs_files[] = {
>  	{ "tvout", tvout_dbg_show, 0, NULL },
>  };
>  
> -static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
> +static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(tvout_debugfs_files); i++)
>  		tvout_debugfs_files[i].data = tvout;
>  
> -	return drm_debugfs_create_files(tvout_debugfs_files,
> -					ARRAY_SIZE(tvout_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(tvout_debugfs_files,
> +				 ARRAY_SIZE(tvout_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode)
> @@ -603,14 +603,11 @@ static void sti_tvout_encoder_destroy(struct drm_encoder *encoder)
>  static int sti_tvout_late_register(struct drm_encoder *encoder)
>  {
>  	struct sti_tvout *tvout = to_sti_tvout(encoder);
> -	int ret;
>  
>  	if (tvout->debugfs_registered)
>  		return 0;
>  
> -	ret = tvout_debugfs_init(tvout, encoder->dev->primary);
> -	if (ret)
> -		return ret;
> +	tvout_debugfs_init(tvout, encoder->dev->primary);
>  
>  	tvout->debugfs_registered = true;
>  	return 0;
> diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
> index 2d4230410464..2d818397918d 100644
> --- a/drivers/gpu/drm/sti/sti_vid.c
> +++ b/drivers/gpu/drm/sti/sti_vid.c
> @@ -124,16 +124,16 @@ static struct drm_info_list vid_debugfs_files[] = {
>  	{ "vid", vid_dbg_show, 0, NULL },
>  };
>  
> -int vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
> +void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
>  {
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(vid_debugfs_files); i++)
>  		vid_debugfs_files[i].data = vid;
>  
> -	return drm_debugfs_create_files(vid_debugfs_files,
> -					ARRAY_SIZE(vid_debugfs_files),
> -					minor->debugfs_root, minor);
> +	drm_debugfs_create_files(vid_debugfs_files,
> +				 ARRAY_SIZE(vid_debugfs_files),
> +				 minor->debugfs_root, minor);
>  }
>  
>  void sti_vid_commit(struct sti_vid *vid,
> diff --git a/drivers/gpu/drm/sti/sti_vid.h b/drivers/gpu/drm/sti/sti_vid.h
> index 9dbd78461de1..991849ba50b5 100644
> --- a/drivers/gpu/drm/sti/sti_vid.h
> +++ b/drivers/gpu/drm/sti/sti_vid.h
> @@ -26,6 +26,6 @@ void sti_vid_disable(struct sti_vid *vid);
>  struct sti_vid *sti_vid_create(struct device *dev, struct drm_device *drm_dev,
>  			       int id, void __iomem *baseaddr);
>  
> -int vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor);
> +void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor);
>  
>  #endif
> -- 
> 2.25.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 07/21] drm/arm: make hdlcd_debugfs_init() return void
  2020-02-27 12:02 ` [PATCH 07/21] drm/arm: make hdlcd_debugfs_init() " Wambui Karuga
@ 2020-02-27 14:53   ` Liviu Dudau
  0 siblings, 0 replies; 40+ messages in thread
From: Liviu Dudau @ 2020-02-27 14:53 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, Brian Starkey, linux-kernel, gregkh, dri-devel

On Thu, Feb 27, 2020 at 03:02:18PM +0300, Wambui Karuga wrote:
> Since commit 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files()
> never fails, and should return void. Therefore, remove its use as a
> return value in hdlcd_debugfs_init and have the latter function
> return void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Not sure how you're going to address Greg KH's comment (maybe one single patch that
converts debugfs_init to void *and* changes the signature to all hooks?) but I'm
going to assume that you will get the whole series merged in one go so I don't have
to push this individual patch into HDLCD tree.

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 2e053815b54a..194419f47c5e 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -224,10 +224,11 @@ static struct drm_info_list hdlcd_debugfs_list[] = {
>  	{ "clocks", hdlcd_show_pxlclock, 0 },
>  };
>  
> -static int hdlcd_debugfs_init(struct drm_minor *minor)
> +static void hdlcd_debugfs_init(struct drm_minor *minor)
>  {
> -	return drm_debugfs_create_files(hdlcd_debugfs_list,
> -		ARRAY_SIZE(hdlcd_debugfs_list),	minor->debugfs_root, minor);
> +	drm_debugfs_create_files(hdlcd_debugfs_list,
> +				 ARRAY_SIZE(hdlcd_debugfs_list),
> +				 minor->debugfs_root, minor);
>  }
>  #endif
>  
> -- 
> 2.25.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 21/21] drm/arm: have malidp_debufs_init() return void
  2020-02-27 12:02 ` [PATCH 21/21] drm/arm: have malidp_debufs_init() " Wambui Karuga
@ 2020-02-27 14:53   ` Liviu Dudau
  0 siblings, 0 replies; 40+ messages in thread
From: Liviu Dudau @ 2020-02-27 14:53 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, Brian Starkey, linux-kernel, gregkh, dri-devel

On Thu, Feb 27, 2020 at 03:02:32PM +0300, Wambui Karuga wrote:
> As there's no need for the return value in malidp_debugfs_init() after
> the conversion of the drm_driver.debugfs_init() hook, (drm: convert the
> .debugs_init() hook to return void), convert the malidp_debugfs_init()
> function to return void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Thanks!
Liviu

> ---
>  drivers/gpu/drm/arm/malidp_drv.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index 37d92a06318e..def8c9ffafca 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -548,7 +548,7 @@ static const struct file_operations malidp_debugfs_fops = {
>  	.release = single_release,
>  };
>  
> -static int malidp_debugfs_init(struct drm_minor *minor)
> +static void malidp_debugfs_init(struct drm_minor *minor)
>  {
>  	struct malidp_drm *malidp = minor->dev->dev_private;
>  
> @@ -557,7 +557,6 @@ static int malidp_debugfs_init(struct drm_minor *minor)
>  	spin_lock_init(&malidp->errors_lock);
>  	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root,
>  			    minor->dev, &malidp_debugfs_fops);
> -	return 0;
>  }
>  
>  #endif //CONFIG_DEBUG_FS
> -- 
> 2.25.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 12/21] drm/msm: remove checks for return value of drm_debugfs functions.
  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
  1 sibling, 0 replies; 40+ messages in thread
From: kbuild test robot @ 2020-02-28  7:24 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: kbuild-all, daniel, airlied, Rob Clark, Sean Paul, linux-kernel,
	gregkh, dri-devel, linux-arm-msm, freedreno

[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]

Hi Wambui,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on linus/master v5.6-rc3 next-20200227]
[cannot apply to tegra/for-next anholt/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Wambui-Karuga/drm-subsytem-wide-debugfs-functions-refactor/20200228-102633
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1437:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      .debugfs_init = a5xx_debugfs_init,
                      ^~~~~~~~~~~~~~~~~
   drivers/gpu/drm/msm/adreno/a5xx_gpu.c:1437:19: note: (near initialization for 'funcs.base.debugfs_init')
   cc1: some warnings being treated as errors
--
>> drivers/gpu/drm/msm/adreno/a5xx_debugfs.c:151:6: error: conflicting types for 'a5xx_debugfs_init'
    void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
         ^~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/msm/adreno/a5xx_debugfs.c:12:0:
   drivers/gpu/drm/msm/adreno/a5xx_gpu.h:44:5: note: previous declaration of 'a5xx_debugfs_init' was here
    int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor);
        ^~~~~~~~~~~~~~~~~

vim +/a5xx_debugfs_init +151 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c

   149	
   150	
 > 151	void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47164 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 04/21] drm/vram-helper: make drm_vram_mm_debugfs_init() return void
  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
  0 siblings, 0 replies; 40+ messages in thread
From: Thomas Zimmermann @ 2020-02-28  8:03 UTC (permalink / raw)
  To: Wambui Karuga, daniel, airlied, Maarten Lankhorst, Maxime Ripard
  Cc: gregkh, linux-kernel, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2403 bytes --]

Hi

Am 27.02.20 um 13:02 schrieb Wambui Karuga:
> Since 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail), drm_debugfs_create_files() never
> fails and should return void. Therefore, remove its use as the
> return value of drm_vram_mm_debugfs_init(), and have the function
> declared as void instead.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>  drivers/gpu/drm/drm_gem_vram_helper.c | 14 ++++----------
>  include/drm/drm_gem_vram_helper.h     |  2 +-
>  2 files changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
> index 92a11bb42365..76506bedac11 100644
> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
> @@ -1042,20 +1042,14 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
>   *
>   * @minor: drm minor device.
>   *
> - * Returns:
> - * 0 on success, or
> - * a negative error code otherwise.
>   */
> -int drm_vram_mm_debugfs_init(struct drm_minor *minor)
> +void drm_vram_mm_debugfs_init(struct drm_minor *minor)
>  {
> -	int ret = 0;
> -
>  #if defined(CONFIG_DEBUG_FS)
> -	ret = drm_debugfs_create_files(drm_vram_mm_debugfs_list,
> -				       ARRAY_SIZE(drm_vram_mm_debugfs_list),
> -				       minor->debugfs_root, minor);
> +	drm_debugfs_create_files(drm_vram_mm_debugfs_list,
> +				 ARRAY_SIZE(drm_vram_mm_debugfs_list),
> +				 minor->debugfs_root, minor);
>  #endif
> -	return ret;
>  }
>  EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
>  
> diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
> index 0f6e47213d8d..b63bcd1b996d 100644
> --- a/include/drm/drm_gem_vram_helper.h
> +++ b/include/drm/drm_gem_vram_helper.h
> @@ -196,7 +196,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev(
>  	return container_of(bdev, struct drm_vram_mm, bdev);
>  }
>  
> -int drm_vram_mm_debugfs_init(struct drm_minor *minor);
> +void drm_vram_mm_debugfs_init(struct drm_minor *minor);
>  
>  /*
>   * Helpers for integration with struct drm_device
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  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
  0 siblings, 1 reply; 40+ messages in thread
From: Thierry Reding @ 2020-03-11 14:37 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, Jonathan Hunter, linux-kernel, gregkh,
	dri-devel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
> 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.
> 
> This change also includes removing the use of drm_debugfs_create_files
> as a return value in tegra_debugfs_init() and have the function declared
> as void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> ---
>  drivers/gpu/drm/tegra/dc.c   | 11 +----------
>  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
>  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
>  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
>  drivers/gpu/drm/tegra/sor.c  | 11 +----------
>  5 files changed, 8 insertions(+), 44 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-03-11 14:37   ` Thierry Reding
@ 2020-03-11 14:54     ` Wambui Karuga
  2020-03-11 23:24       ` Thierry Reding
  0 siblings, 1 reply; 40+ messages in thread
From: Wambui Karuga @ 2020-03-11 14:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Wambui Karuga, daniel, airlied, Jonathan Hunter, linux-kernel,
	gregkh, dri-devel, linux-tegra

Hey Thierry,

On Wed, 11 Mar 2020, Thierry Reding wrote:

> On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
>> 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.
>>
>> This change also includes removing the use of drm_debugfs_create_files
>> as a return value in tegra_debugfs_init() and have the function declared
>> as void.
>>
>> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
>> ---
>>  drivers/gpu/drm/tegra/dc.c   | 11 +----------
>>  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
>>  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
>>  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
>>  drivers/gpu/drm/tegra/sor.c  | 11 +----------
>>  5 files changed, 8 insertions(+), 44 deletions(-)
>
> Applied, thanks.
>
There's a newer version[1] of this patch series as this specific patch 
depends on other work in drm.

Thanks,
wambui karuga.

[1] https://lists.freedesktop.org/archives/dri-devel/2020-March/258793.html
> Thierry
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-03-11 14:54     ` Wambui Karuga
@ 2020-03-11 23:24       ` Thierry Reding
  2020-03-16  8:33         ` Daniel Vetter
  0 siblings, 1 reply; 40+ messages in thread
From: Thierry Reding @ 2020-03-11 23:24 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel, airlied, Jonathan Hunter, linux-kernel, gregkh,
	dri-devel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]

On Wed, Mar 11, 2020 at 05:54:46PM +0300, Wambui Karuga wrote:
> Hey Thierry,
> 
> On Wed, 11 Mar 2020, Thierry Reding wrote:
> 
> > On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
> > > 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.
> > > 
> > > This change also includes removing the use of drm_debugfs_create_files
> > > as a return value in tegra_debugfs_init() and have the function declared
> > > as void.
> > > 
> > > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> > > ---
> > >  drivers/gpu/drm/tegra/dc.c   | 11 +----------
> > >  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
> > >  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
> > >  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
> > >  drivers/gpu/drm/tegra/sor.c  | 11 +----------
> > >  5 files changed, 8 insertions(+), 44 deletions(-)
> > 
> > Applied, thanks.
> > 
> There's a newer version[1] of this patch series as this specific patch
> depends on other work in drm.

Oh yeah, I just noticed that this patch causes a build failure, so I
backed it out again.

If there's dependencies on other work, it's probably best to take this
through drm-misc, in which case:

Acked-by: Thierry Reding <treding@nvidia.com>

Let me know if you'd prefer me to apply this to drm/tegra instead.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-03-11 23:24       ` Thierry Reding
@ 2020-03-16  8:33         ` Daniel Vetter
  0 siblings, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2020-03-16  8:33 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Wambui Karuga, daniel, airlied, Jonathan Hunter, linux-kernel,
	gregkh, dri-devel, linux-tegra

On Thu, Mar 12, 2020 at 12:24:46AM +0100, Thierry Reding wrote:
> On Wed, Mar 11, 2020 at 05:54:46PM +0300, Wambui Karuga wrote:
> > Hey Thierry,
> > 
> > On Wed, 11 Mar 2020, Thierry Reding wrote:
> > 
> > > On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
> > > > 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.
> > > > 
> > > > This change also includes removing the use of drm_debugfs_create_files
> > > > as a return value in tegra_debugfs_init() and have the function declared
> > > > as void.
> > > > 
> > > > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> > > > ---
> > > >  drivers/gpu/drm/tegra/dc.c   | 11 +----------
> > > >  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
> > > >  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
> > > >  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
> > > >  drivers/gpu/drm/tegra/sor.c  | 11 +----------
> > > >  5 files changed, 8 insertions(+), 44 deletions(-)
> > > 
> > > Applied, thanks.
> > > 
> > There's a newer version[1] of this patch series as this specific patch
> > depends on other work in drm.
> 
> Oh yeah, I just noticed that this patch causes a build failure, so I
> backed it out again.
> 
> If there's dependencies on other work, it's probably best to take this
> through drm-misc, in which case:
> 
> Acked-by: Thierry Reding <treding@nvidia.com>
> 
> Let me know if you'd prefer me to apply this to drm/tegra instead.

Yeah I'm going to pull in the entire series through -misc rsn.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2020-03-16  8:33 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 12:02 [PATCH 00/21] drm: subsytem-wide debugfs functions refactor Wambui Karuga
2020-02-27 12:02 ` [PATCH 01/21] drm/debugfs: remove checks for return value of drm_debugfs functions Wambui Karuga
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

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).