[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251219054320.447281-5-chintanlike@gmail.com>
Date: Thu, 18 Dec 2025 21:43:19 -0800
From: Chintan Patel <chintanlike@...il.com>
To: linux-fbdev@...r.kernel.org,
linux-staging@...ts.linux.dev,
linux-omap@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
tzimmermann@...e.de,
andy@...nel.org,
deller@....de,
gregkh@...uxfoundation.org,
Chintan Patel <chintanlike@...il.com>
Subject: [PATCH v2 4/4] fbdev: sh_mobile_lcdc: Make FB_DEVICE dependency optional
The sh_mobile_lcdc driver exposes overlay configuration via sysfs, but the
core driver does not require CONFIG_FB_DEVICE.
Make sysfs support optional by defining overlay_sysfs_groups as NULL when
FB_DEVICE is disabled. The driver always sets .dev_groups, and the kernel
naturally skips NULL attribute groups while the code remains buildable
and type-checked.
v2:
- Replace CONFIG_FB_DEVICE ifdefs with NULL overlay_sysfs_groups
- Always populate .dev_groups
Suggested-by: Helge Deller <deller@....de>
Signed-off-by: Chintan Patel <chintanlike@...il.com>
---
drivers/video/fbdev/sh_mobile_lcdcfb.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index dd950e4ab5ce..704c17ad241e 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -1350,7 +1350,16 @@ static struct attribute *overlay_sysfs_attrs[] = {
&dev_attr_overlay_rop3.attr,
NULL,
};
+
+#ifdef CONFIG_FB_DEVICE
ATTRIBUTE_GROUPS(overlay_sysfs);
+#else
+/*
+ * When CONFIG_FB_DEVICE is disabled, define overlay_sysfs_groups as NULL.
+ * The compiler will optimize out the sysfs code paths when dev_groups is NULL.
+ */
+static const struct attribute_group *overlay_sysfs_groups[] = { NULL };
+#endif
static const struct fb_fix_screeninfo sh_mobile_lcdc_overlay_fix = {
.id = "SH Mobile LCDC",
--
2.43.0
Powered by blists - more mailing lists