[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251209042744.7875-3-chintanlike@gmail.com>
Date: Mon, 8 Dec 2025 20:27:43 -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 2/3] omapfb: Guard sysfs code under CONFIG_FB_DEVICE
omapfb implements multiple sysfs attributes for framebuffer rotation,
overlays, and debug information. These interfaces depend on FB_DEVICE
being enabled.
This patch wraps all sysfs attribute definitions, registration, and
removal in #ifdef CONFIG_FB_DEVICE. For FB_DEVICE=n, lightweight stub
functions are provided so that the driver builds and runs without
exposing sysfs interfaces.
Signed-off-by: Chintan Patel <chintanlike@...il.com>
---
drivers/video/fbdev/omap2/omapfb/Kconfig | 2 +-
drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/omapfb/Kconfig b/drivers/video/fbdev/omap2/omapfb/Kconfig
index f4cdf999a080..ee664decbb64 100644
--- a/drivers/video/fbdev/omap2/omapfb/Kconfig
+++ b/drivers/video/fbdev/omap2/omapfb/Kconfig
@@ -5,7 +5,6 @@ config OMAP2_VRFB
menuconfig FB_OMAP2
tristate "OMAP2+ frame buffer support"
depends on FB
- depends on FB_DEVICE
depends on DRM_OMAP = n
depends on GPIOLIB
select FB_OMAP2_DSS
@@ -13,6 +12,7 @@ menuconfig FB_OMAP2
select FB_IOMEM_HELPERS
help
Frame buffer driver for OMAP2+ based boards.
+ Selecting FB_DEVICE enables additional sysfs interfaces.
if FB_OMAP2
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
index 831b2c2fbdf9..0a340f69484f 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-sysfs.c
@@ -24,6 +24,7 @@
#include "omapfb.h"
+#ifdef CONFIG_FB_DEVICE
static ssize_t show_rotate_type(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -585,4 +586,14 @@ void omapfb_remove_sysfs(struct omapfb2_device *fbdev)
&omapfb_attrs[t]);
}
}
+#else
+int omapfb_create_sysfs(struct omapfb2_device *fbdev)
+{
+ return 0;
+}
+
+void omapfb_remove_sysfs(struct omapfb2_device *fbdev)
+{
+}
+#endif
--
2.43.0
Powered by blists - more mailing lists