Commit 7ce84471 authored by Wambui Karuga's avatar Wambui Karuga Committed by Daniel Vetter

drm: convert .debugfs_init() hook to return void.

As a result of commit 987d65d0 (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.

This also includes refactoring all users of the .debugfs_init() hook to
return void across the subsystem.

v2: include changes to the hook and drivers that use it in one patch to
prevent driver breakage and enable individual successful compilation of
this change.

References: https://lists.freedesktop.org/archives/dri-devel/2020-February/257183.htmlSigned-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200310133121.27913-18-wambui.karugax@gmail.com
parent 0df10823
...@@ -137,12 +137,11 @@ static struct drm_info_list arcpgu_debugfs_list[] = { ...@@ -137,12 +137,11 @@ static struct drm_info_list arcpgu_debugfs_list[] = {
{ "clocks", arcpgu_show_pxlclock, 0 }, { "clocks", arcpgu_show_pxlclock, 0 },
}; };
static int arcpgu_debugfs_init(struct drm_minor *minor) static void arcpgu_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(arcpgu_debugfs_list, drm_debugfs_create_files(arcpgu_debugfs_list,
ARRAY_SIZE(arcpgu_debugfs_list), ARRAY_SIZE(arcpgu_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
......
...@@ -224,12 +224,11 @@ static struct drm_info_list hdlcd_debugfs_list[] = { ...@@ -224,12 +224,11 @@ static struct drm_info_list hdlcd_debugfs_list[] = {
{ "clocks", hdlcd_show_pxlclock, 0 }, { "clocks", hdlcd_show_pxlclock, 0 },
}; };
static int hdlcd_debugfs_init(struct drm_minor *minor) static void hdlcd_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(hdlcd_debugfs_list, drm_debugfs_create_files(hdlcd_debugfs_list,
ARRAY_SIZE(hdlcd_debugfs_list), ARRAY_SIZE(hdlcd_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
......
...@@ -548,7 +548,7 @@ static const struct file_operations malidp_debugfs_fops = { ...@@ -548,7 +548,7 @@ static const struct file_operations malidp_debugfs_fops = {
.release = single_release, .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; struct malidp_drm *malidp = minor->dev->dev_private;
...@@ -557,7 +557,6 @@ static int malidp_debugfs_init(struct drm_minor *minor) ...@@ -557,7 +557,6 @@ static int malidp_debugfs_init(struct drm_minor *minor)
spin_lock_init(&malidp->errors_lock); spin_lock_init(&malidp->errors_lock);
debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root, debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root,
minor->dev, &malidp_debugfs_fops); minor->dev, &malidp_debugfs_fops);
return 0;
} }
#endif //CONFIG_DEBUG_FS #endif //CONFIG_DEBUG_FS
......
...@@ -1641,11 +1641,10 @@ static const struct drm_info_list drm_atomic_debugfs_list[] = { ...@@ -1641,11 +1641,10 @@ static const struct drm_info_list drm_atomic_debugfs_list[] = {
{"state", drm_state_info, 0}, {"state", drm_state_info, 0},
}; };
int drm_atomic_debugfs_init(struct drm_minor *minor) void drm_atomic_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(drm_atomic_debugfs_list, drm_debugfs_create_files(drm_atomic_debugfs_list,
ARRAY_SIZE(drm_atomic_debugfs_list), ARRAY_SIZE(drm_atomic_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
...@@ -457,12 +457,10 @@ static const struct drm_info_list drm_client_debugfs_list[] = { ...@@ -457,12 +457,10 @@ static const struct drm_info_list drm_client_debugfs_list[] = {
{ "internal_clients", drm_client_debugfs_internal_clients, 0 }, { "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)
{ {
drm_debugfs_create_files(drm_client_debugfs_list, drm_debugfs_create_files(drm_client_debugfs_list,
ARRAY_SIZE(drm_client_debugfs_list), ARRAY_SIZE(drm_client_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
...@@ -225,7 +225,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, ...@@ -225,7 +225,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
/* drm_atomic.c */ /* drm_atomic.c */
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct drm_minor; struct drm_minor;
int drm_atomic_debugfs_init(struct drm_minor *minor); void drm_atomic_debugfs_init(struct drm_minor *minor);
#endif #endif
int __drm_atomic_helper_disable_plane(struct drm_plane *plane, int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
......
...@@ -207,7 +207,6 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, ...@@ -207,7 +207,6 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
{ {
struct drm_device *dev = minor->dev; struct drm_device *dev = minor->dev;
char name[64]; char name[64];
int ret;
INIT_LIST_HEAD(&minor->debugfs_list); INIT_LIST_HEAD(&minor->debugfs_list);
mutex_init(&minor->debugfs_lock); mutex_init(&minor->debugfs_lock);
...@@ -227,14 +226,9 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, ...@@ -227,14 +226,9 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
drm_client_debugfs_init(minor); drm_client_debugfs_init(minor);
} }
if (dev->driver->debugfs_init) { if (dev->driver->debugfs_init)
ret = dev->driver->debugfs_init(minor); dev->driver->debugfs_init(minor);
if (ret) {
DRM_ERROR("DRM: Driver failed to initialize "
"/sys/kernel/debug/dri.\n");
return ret;
}
}
return 0; return 0;
} }
......
...@@ -1207,12 +1207,10 @@ static const struct drm_info_list drm_framebuffer_debugfs_list[] = { ...@@ -1207,12 +1207,10 @@ static const struct drm_info_list drm_framebuffer_debugfs_list[] = {
{ "framebuffer", drm_framebuffer_info, 0 }, { "framebuffer", drm_framebuffer_info, 0 },
}; };
int drm_framebuffer_debugfs_init(struct drm_minor *minor) void drm_framebuffer_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(drm_framebuffer_debugfs_list, drm_debugfs_create_files(drm_framebuffer_debugfs_list,
ARRAY_SIZE(drm_framebuffer_debugfs_list), ARRAY_SIZE(drm_framebuffer_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
...@@ -1042,18 +1042,14 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = { ...@@ -1042,18 +1042,14 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
* *
* @minor: drm minor device. * @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)
{ {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
drm_debugfs_create_files(drm_vram_mm_debugfs_list, drm_debugfs_create_files(drm_vram_mm_debugfs_list,
ARRAY_SIZE(drm_vram_mm_debugfs_list), ARRAY_SIZE(drm_vram_mm_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
#endif #endif
return 0;
} }
EXPORT_SYMBOL(drm_vram_mm_debugfs_init); EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
......
...@@ -235,4 +235,4 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data, ...@@ -235,4 +235,4 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
/* drm_framebuffer.c */ /* drm_framebuffer.c */
void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent, void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
const struct drm_framebuffer *fb); const struct drm_framebuffer *fb);
int drm_framebuffer_debugfs_init(struct drm_minor *minor); void drm_framebuffer_debugfs_init(struct drm_minor *minor);
...@@ -1308,10 +1308,8 @@ static const struct file_operations mipi_dbi_debugfs_command_fops = { ...@@ -1308,10 +1308,8 @@ static const struct file_operations mipi_dbi_debugfs_command_fops = {
* controller or getting the read command values. * controller or getting the read command values.
* Drivers can use this as their &drm_driver->debugfs_init callback. * 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); struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(minor->dev);
umode_t mode = S_IFREG | S_IWUSR; umode_t mode = S_IFREG | S_IWUSR;
...@@ -1320,8 +1318,6 @@ int mipi_dbi_debugfs_init(struct drm_minor *minor) ...@@ -1320,8 +1318,6 @@ int mipi_dbi_debugfs_init(struct drm_minor *minor)
mode |= S_IRUGO; mode |= S_IRUGO;
debugfs_create_file("command", mode, minor->debugfs_root, dbidev, debugfs_create_file("command", mode, minor->debugfs_root, dbidev,
&mipi_dbi_debugfs_command_fops); &mipi_dbi_debugfs_command_fops);
return 0;
} }
EXPORT_SYMBOL(mipi_dbi_debugfs_init); EXPORT_SYMBOL(mipi_dbi_debugfs_init);
......
...@@ -231,13 +231,11 @@ static struct drm_info_list etnaviv_debugfs_list[] = { ...@@ -231,13 +231,11 @@ static struct drm_info_list etnaviv_debugfs_list[] = {
{"ring", show_each_gpu, 0, etnaviv_ring_show}, {"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)
{ {
drm_debugfs_create_files(etnaviv_debugfs_list, drm_debugfs_create_files(etnaviv_debugfs_list,
ARRAY_SIZE(etnaviv_debugfs_list), ARRAY_SIZE(etnaviv_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
......
...@@ -148,12 +148,12 @@ reset_set(void *data, u64 val) ...@@ -148,12 +148,12 @@ reset_set(void *data, u64 val)
DEFINE_SIMPLE_ATTRIBUTE(reset_fops, NULL, reset_set, "%llx\n"); 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; struct drm_device *dev;
if (!minor) if (!minor)
return 0; return;
dev = minor->dev; dev = minor->dev;
...@@ -163,6 +163,4 @@ int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor) ...@@ -163,6 +163,4 @@ int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
debugfs_create_file("reset", S_IWUGO, minor->debugfs_root, dev, debugfs_create_file("reset", S_IWUGO, minor->debugfs_root, dev,
&reset_fops); &reset_fops);
return 0;
} }
...@@ -41,7 +41,7 @@ struct a5xx_gpu { ...@@ -41,7 +41,7 @@ struct a5xx_gpu {
#define to_a5xx_gpu(x) container_of(x, struct a5xx_gpu, base) #define to_a5xx_gpu(x) container_of(x, struct a5xx_gpu, base)
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor); void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor);
#endif #endif
/* /*
......
...@@ -214,11 +214,10 @@ int msm_debugfs_late_init(struct drm_device *dev) ...@@ -214,11 +214,10 @@ int msm_debugfs_late_init(struct drm_device *dev)
return ret; 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 drm_device *dev = minor->dev;
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
int ret;
drm_debugfs_create_files(msm_debugfs_list, drm_debugfs_create_files(msm_debugfs_list,
ARRAY_SIZE(msm_debugfs_list), ARRAY_SIZE(msm_debugfs_list),
...@@ -227,13 +226,8 @@ int msm_debugfs_init(struct drm_minor *minor) ...@@ -227,13 +226,8 @@ int msm_debugfs_init(struct drm_minor *minor)
debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root, debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root,
dev, &msm_gpu_fops); dev, &msm_gpu_fops);
if (priv->kms && priv->kms->funcs->debugfs_init) { if (priv->kms && priv->kms->funcs->debugfs_init)
ret = priv->kms->funcs->debugfs_init(priv->kms, minor); priv->kms->funcs->debugfs_init(priv->kms, minor);
if (ret)
return ret;
}
return 0;
} }
#endif #endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#define __MSM_DEBUGFS_H__ #define __MSM_DEBUGFS_H__
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
int msm_debugfs_init(struct drm_minor *minor); void msm_debugfs_init(struct drm_minor *minor);
#endif #endif
#endif /* __MSM_DEBUGFS_H__ */ #endif /* __MSM_DEBUGFS_H__ */
...@@ -57,7 +57,7 @@ struct msm_gpu_funcs { ...@@ -57,7 +57,7 @@ struct msm_gpu_funcs {
void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state, void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
struct drm_printer *p); struct drm_printer *p);
/* for generation specific debugfs: */ /* 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 #endif
unsigned long (*gpu_busy)(struct msm_gpu *gpu); unsigned long (*gpu_busy)(struct msm_gpu *gpu);
struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu); struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu);
......
...@@ -217,7 +217,7 @@ static const struct nouveau_debugfs_files { ...@@ -217,7 +217,7 @@ static const struct nouveau_debugfs_files {
{"pstate", &nouveau_pstate_fops}, {"pstate", &nouveau_pstate_fops},
}; };
int void
nouveau_drm_debugfs_init(struct drm_minor *minor) nouveau_drm_debugfs_init(struct drm_minor *minor)
{ {
struct nouveau_drm *drm = nouveau_drm(minor->dev); struct nouveau_drm *drm = nouveau_drm(minor->dev);
...@@ -240,12 +240,10 @@ nouveau_drm_debugfs_init(struct drm_minor *minor) ...@@ -240,12 +240,10 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
*/ */
dentry = debugfs_lookup("vbios.rom", minor->debugfs_root); dentry = debugfs_lookup("vbios.rom", minor->debugfs_root);
if (!dentry) if (!dentry)
return 0; return;
d_inode(dentry)->i_size = drm->vbios.length; d_inode(dentry)->i_size = drm->vbios.length;
dput(dentry); dput(dentry);
return 0;
} }
int int
......
...@@ -18,15 +18,13 @@ nouveau_debugfs(struct drm_device *dev) ...@@ -18,15 +18,13 @@ nouveau_debugfs(struct drm_device *dev)
return nouveau_drm(dev)->debugfs; 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 int nouveau_debugfs_init(struct nouveau_drm *);
extern void nouveau_debugfs_fini(struct nouveau_drm *); extern void nouveau_debugfs_fini(struct nouveau_drm *);
#else #else
static inline int static inline void
nouveau_drm_debugfs_init(struct drm_minor *minor) nouveau_drm_debugfs_init(struct drm_minor *minor)
{ {}
return 0;
}
static inline int static inline int
nouveau_debugfs_init(struct nouveau_drm *drm) nouveau_debugfs_init(struct nouveau_drm *drm)
......
...@@ -80,7 +80,7 @@ static struct drm_info_list omap_dmm_debugfs_list[] = { ...@@ -80,7 +80,7 @@ static struct drm_info_list omap_dmm_debugfs_list[] = {
{"tiler_map", tiler_map_show, 0}, {"tiler_map", tiler_map_show, 0},
}; };
int omap_debugfs_init(struct drm_minor *minor) void omap_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(omap_debugfs_list, drm_debugfs_create_files(omap_debugfs_list,
ARRAY_SIZE(omap_debugfs_list), ARRAY_SIZE(omap_debugfs_list),
...@@ -90,8 +90,6 @@ int omap_debugfs_init(struct drm_minor *minor) ...@@ -90,8 +90,6 @@ int omap_debugfs_init(struct drm_minor *minor)
drm_debugfs_create_files(omap_dmm_debugfs_list, drm_debugfs_create_files(omap_dmm_debugfs_list,
ARRAY_SIZE(omap_dmm_debugfs_list), ARRAY_SIZE(omap_dmm_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
...@@ -82,6 +82,6 @@ struct omap_drm_private { ...@@ -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__ */ #endif /* __OMAPDRM_DRV_H__ */
...@@ -51,12 +51,10 @@ static const struct drm_info_list pl111_debugfs_list[] = { ...@@ -51,12 +51,10 @@ static const struct drm_info_list pl111_debugfs_list[] = {
{"regs", pl111_debugfs_regs, 0}, {"regs", pl111_debugfs_regs, 0},
}; };
int void
pl111_debugfs_init(struct drm_minor *minor) pl111_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(pl111_debugfs_list, drm_debugfs_create_files(pl111_debugfs_list,
ARRAY_SIZE(pl111_debugfs_list), ARRAY_SIZE(pl111_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
...@@ -84,6 +84,6 @@ struct pl111_drm_dev_private { ...@@ -84,6 +84,6 @@ struct pl111_drm_dev_private {
int pl111_display_init(struct drm_device *dev); int pl111_display_init(struct drm_device *dev);
irqreturn_t pl111_irq(int irq, void *data); 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_ */ #endif /* _PL111_DRM_H_ */
...@@ -79,36 +79,30 @@ static struct drm_info_list qxl_debugfs_list[] = { ...@@ -79,36 +79,30 @@ static struct drm_info_list qxl_debugfs_list[] = {
#define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list) #define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list)
#endif #endif
int void
qxl_debugfs_init(struct drm_minor *minor) qxl_debugfs_init(struct drm_minor *minor)
{ {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
int r;
struct qxl_device *dev = struct qxl_device *dev =
(struct qxl_device *) minor->dev->dev_private; (struct qxl_device *) minor->dev->dev_private;
drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES, drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
minor->debugfs_root, minor); minor->debugfs_root, minor);
r = qxl_ttm_debugfs_init(dev); qxl_ttm_debugfs_init(dev);
if (r) {
DRM_ERROR("Failed to init TTM debugfs\n");
return r;
}
#endif #endif
return 0;
} }
int qxl_debugfs_add_files(struct qxl_device *qdev, void qxl_debugfs_add_files(struct qxl_device *qdev,
struct drm_info_list *files, struct drm_info_list *files,
unsigned int nfiles) unsigned int nfiles)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < qdev->debugfs_count; i++) { for (i = 0; i < qdev->debugfs_count; i++) {
if (qdev->debugfs[i].files == files) { if (qdev->debugfs[i].files == files) {
/* Already registered */ /* Already registered */
return 0; return;
} }
} }
...@@ -116,7 +110,7 @@ int qxl_debugfs_add_files(struct qxl_device *qdev, ...@@ -116,7 +110,7 @@ int qxl_debugfs_add_files(struct qxl_device *qdev,
if (i > QXL_DEBUGFS_MAX_COMPONENTS) { if (i > QXL_DEBUGFS_MAX_COMPONENTS) {
DRM_ERROR("Reached maximum number of debugfs components.\n"); DRM_ERROR("Reached maximum number of debugfs components.\n");
DRM_ERROR("Report so we increase QXL_DEBUGFS_MAX_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].files = files;
qdev->debugfs[qdev->debugfs_count].num_files = nfiles; qdev->debugfs[qdev->debugfs_count].num_files = nfiles;
...@@ -126,5 +120,4 @@ int qxl_debugfs_add_files(struct qxl_device *qdev, ...@@ -126,5 +120,4 @@ int qxl_debugfs_add_files(struct qxl_device *qdev,
qdev->ddev.primary->debugfs_root, qdev->ddev.primary->debugfs_root,
qdev->ddev.primary); qdev->ddev.primary);
#endif #endif
return 0;
} }
...@@ -190,9 +190,6 @@ struct qxl_debugfs { ...@@ -190,9 +190,6 @@ struct qxl_debugfs {
unsigned int num_files; 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); int qxl_debugfs_fence_init(struct qxl_device *rdev);
struct qxl_device; struct qxl_device;
...@@ -442,8 +439,8 @@ int qxl_garbage_collect(struct qxl_device *qdev); ...@@ -442,8 +439,8 @@ int qxl_garbage_collect(struct qxl_device *qdev);
/* debugfs */ /* debugfs */
int qxl_debugfs_init(struct drm_minor *minor); void qxl_debugfs_init(struct drm_minor *minor);
int qxl_ttm_debugfs_init(struct qxl_device *qdev); void qxl_ttm_debugfs_init(struct qxl_device *qdev);
/* qxl_prime.c */ /* qxl_prime.c */
int qxl_gem_prime_pin(struct drm_gem_object *obj); int qxl_gem_prime_pin(struct drm_gem_object *obj);
...@@ -461,9 +458,9 @@ int qxl_gem_prime_mmap(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); int qxl_irq_init(struct qxl_device *qdev);
irqreturn_t qxl_irq_handler(int irq, void *arg); irqreturn_t qxl_irq_handler(int irq, void *arg);
int qxl_debugfs_add_files(struct qxl_device *qdev, void qxl_debugfs_add_files(struct qxl_device *qdev,
struct drm_info_list *files, struct drm_info_list *files,
unsigned int nfiles); unsigned int nfiles);
int qxl_surface_id_alloc(struct qxl_device *qdev, int qxl_surface_id_alloc(struct qxl_device *qdev,
struct qxl_bo *surf); struct qxl_bo *surf);
......
...@@ -322,7 +322,7 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data) ...@@ -322,7 +322,7 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data)
} }
#endif #endif
int qxl_ttm_debugfs_init(struct qxl_device *qdev) void qxl_ttm_debugfs_init(struct qxl_device *qdev)
{ {
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES]; 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) ...@@ -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; 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); qxl_debugfs_add_files(qdev, qxl_mem_types_list, i);
#else
return 0;
#endif #endif
} }
...@@ -92,7 +92,7 @@ static struct drm_info_list sti_drm_dbg_list[] = { ...@@ -92,7 +92,7 @@ static struct drm_info_list sti_drm_dbg_list[] = {
{"fps_get", sti_drm_fps_dbg_show, 0}, {"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)
{ {
drm_debugfs_create_files(sti_drm_dbg_list, drm_debugfs_create_files(sti_drm_dbg_list,
ARRAY_SIZE(sti_drm_dbg_list), ARRAY_SIZE(sti_drm_dbg_list),
...@@ -102,7 +102,6 @@ static int sti_drm_dbg_init(struct drm_minor *minor) ...@@ -102,7 +102,6 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
minor->dev, &sti_drm_fps_fops); minor->dev, &sti_drm_fps_fops);
DRM_INFO("%s: debugfs installed\n", DRIVER_NAME); DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
return 0;
} }
static const struct drm_mode_config_funcs sti_mode_config_funcs = { static const struct drm_mode_config_funcs sti_mode_config_funcs = {
......
...@@ -839,12 +839,11 @@ static struct drm_info_list tegra_debugfs_list[] = { ...@@ -839,12 +839,11 @@ static struct drm_info_list tegra_debugfs_list[] = {
{ "iova", tegra_debugfs_iova, 0 }, { "iova", tegra_debugfs_iova, 0 },
}; };
static int tegra_debugfs_init(struct drm_minor *minor) static void tegra_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(tegra_debugfs_list, drm_debugfs_create_files(tegra_debugfs_list,
ARRAY_SIZE(tegra_debugfs_list), ARRAY_SIZE(tegra_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
#endif #endif
......
...@@ -478,7 +478,7 @@ static struct drm_info_list tilcdc_debugfs_list[] = { ...@@ -478,7 +478,7 @@ static struct drm_info_list tilcdc_debugfs_list[] = {
{ "mm", tilcdc_mm_show, 0 }, { "mm", tilcdc_mm_show, 0 },
}; };
static int tilcdc_debugfs_init(struct drm_minor *minor) static void tilcdc_debugfs_init(struct drm_minor *minor)
{ {
struct tilcdc_module *mod; struct tilcdc_module *mod;
...@@ -489,8 +489,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor) ...@@ -489,8 +489,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor)
list_for_each_entry(mod, &module_list, list) list_for_each_entry(mod, &module_list, list)
if (mod->funcs->debugfs_init) if (mod->funcs->debugfs_init)
mod->funcs->debugfs_init(mod, minor); mod->funcs->debugfs_init(mod, minor);
return 0;
} }
#endif #endif
......
...@@ -258,11 +258,10 @@ static const struct drm_info_list v3d_debugfs_list[] = { ...@@ -258,11 +258,10 @@ static const struct drm_info_list v3d_debugfs_list[] = {
{"bo_stats", v3d_debugfs_bo_stats, 0}, {"bo_stats", v3d_debugfs_bo_stats, 0},
}; };
int void
v3d_debugfs_init(struct drm_minor *minor) v3d_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(v3d_debugfs_list, drm_debugfs_create_files(v3d_debugfs_list,
ARRAY_SIZE(v3d_debugfs_list), ARRAY_SIZE(v3d_debugfs_list),
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
...@@ -316,7 +316,7 @@ struct drm_gem_object *v3d_prime_import_sg_table(struct drm_device *dev, ...@@ -316,7 +316,7 @@ struct drm_gem_object *v3d_prime_import_sg_table(struct drm_device *dev,
struct sg_table *sgt); struct sg_table *sgt);
/* v3d_debugfs.c */ /* v3d_debugfs.c */
int v3d_debugfs_init(struct drm_minor *minor); void v3d_debugfs_init(struct drm_minor *minor);
/* v3d_fence.c */ /* v3d_fence.c */
extern const struct dma_fence_ops v3d_fence_ops; extern const struct dma_fence_ops v3d_fence_ops;
......
...@@ -20,7 +20,7 @@ struct vc4_debugfs_info_entry { ...@@ -20,7 +20,7 @@ struct vc4_debugfs_info_entry {
* Called at drm_dev_register() time on each of the minors registered * Called at drm_dev_register() time on each of the minors registered
* by the DRM device, to attach the debugfs files. * by the DRM device, to attach the debugfs files.
*/ */
int void
vc4_debugfs_init(struct drm_minor *minor) vc4_debugfs_init(struct drm_minor *minor)
{ {
struct vc4_dev *vc4 = to_vc4_dev(minor->dev); struct vc4_dev *vc4 = to_vc4_dev(minor->dev);
...@@ -33,8 +33,6 @@ vc4_debugfs_init(struct drm_minor *minor) ...@@ -33,8 +33,6 @@ vc4_debugfs_init(struct drm_minor *minor)
drm_debugfs_create_files(&entry->info, 1, drm_debugfs_create_files(&entry->info, 1,
minor->debugfs_root, minor); minor->debugfs_root, minor);
} }
return 0;
} }
static int vc4_debugfs_regset32(struct seq_file *m, void *unused) static int vc4_debugfs_regset32(struct seq_file *m, void *unused)
......
...@@ -759,7 +759,7 @@ void vc4_crtc_get_margins(struct drm_crtc_state *state, ...@@ -759,7 +759,7 @@ void vc4_crtc_get_margins(struct drm_crtc_state *state,
unsigned int *top, unsigned int *bottom); unsigned int *top, unsigned int *bottom);
/* vc4_debugfs.c */ /* vc4_debugfs.c */
int vc4_debugfs_init(struct drm_minor *minor); void vc4_debugfs_init(struct drm_minor *minor);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
void vc4_debugfs_add_file(struct drm_device *drm, void vc4_debugfs_add_file(struct drm_device *drm,
const char *filename, const char *filename,
......
...@@ -72,11 +72,10 @@ static struct drm_info_list virtio_gpu_debugfs_list[] = { ...@@ -72,11 +72,10 @@ static struct drm_info_list virtio_gpu_debugfs_list[] = {
#define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(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) virtio_gpu_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(virtio_gpu_debugfs_list, drm_debugfs_create_files(virtio_gpu_debugfs_list,
VIRTIO_GPU_DEBUGFS_ENTRIES, VIRTIO_GPU_DEBUGFS_ENTRIES,
minor->debugfs_root, minor); minor->debugfs_root, minor);
return 0;
} }
...@@ -379,6 +379,6 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table( ...@@ -379,6 +379,6 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
struct sg_table *sgt); struct sg_table *sgt);
/* virgl debugfs */ /* virgl debugfs */
int virtio_gpu_debugfs_init(struct drm_minor *minor); void virtio_gpu_debugfs_init(struct drm_minor *minor);
#endif #endif
...@@ -188,6 +188,6 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode); ...@@ -188,6 +188,6 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
drm_for_each_connector_iter(connector, iter) \ drm_for_each_connector_iter(connector, iter) \
if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) 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 #endif
...@@ -323,7 +323,7 @@ struct drm_driver { ...@@ -323,7 +323,7 @@ struct drm_driver {
* *
* Allows drivers to create driver-specific debugfs files. * 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 * @gem_free_object: deconstructor for drm_gem_objects
......
...@@ -196,7 +196,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev( ...@@ -196,7 +196,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev(
return container_of(bdev, struct drm_vram_mm, 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 * Helpers for integration with struct drm_device
......
...@@ -192,7 +192,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb, ...@@ -192,7 +192,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
}) })
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
int mipi_dbi_debugfs_init(struct drm_minor *minor); void mipi_dbi_debugfs_init(struct drm_minor *minor);
#else #else
#define mipi_dbi_debugfs_init NULL #define mipi_dbi_debugfs_init NULL
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment