[PATCH] arm/komeda: Compile DEFINE_SHOW_ATTRIBUTE() only when CONFIG_DEBUG_FS is enabled

From: pengfuyuan
Date: Thu Jun 06 2024 - 03:59:59 EST


We do not call komeda_debugfs_init() and the debugfs core function
declaration if CONFIG_DEBUG_FS is not defined, but we should not
compile it either because the debugfs core function declaration is
not included.

Reported-by: k2ci <kernel-bot@xxxxxxxxxx>
Signed-off-by: pengfuyuan <pengfuyuan@xxxxxxxxxx>
---
drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
index 14ee79becacb..7ada8e6f407c 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
@@ -21,6 +21,7 @@

#include "komeda_dev.h"

+#ifdef CONFIG_DEBUG_FS
static int komeda_register_show(struct seq_file *sf, void *x)
{
struct komeda_dev *mdev = sf->private;
@@ -43,7 +44,6 @@ static int komeda_register_show(struct seq_file *sf, void *x)

DEFINE_SHOW_ATTRIBUTE(komeda_register);

-#ifdef CONFIG_DEBUG_FS
static void komeda_debugfs_init(struct komeda_dev *mdev)
{
if (!debugfs_initialized())
--
2.25.1