The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] fbdev: make sh_mobile_lcdc independent of FB_DEVICE
@ 2026-05-09 18:27 Melih Emik
  2026-05-13  7:41 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Melih Emik @ 2026-05-09 18:27 UTC (permalink / raw)
  To: Helge Deller, linux-fbdev, dri-devel
  Cc: Thomas Zimmermann, Wei Liu, Prasanna Kumar T S M, Zsolt Kajtar,
	Mukesh Rathor, linux-kernel

CONFIG_FB_DEVICE controls the fbdev character device interface. SH Mobile
LCDC does not need that interface to build framebuffer support. Tying the
driver option to FB_DEVICE unnecessarily prevents it from being enabled
where device node support is disabled.

Relax the Kconfig dependency so the driver can be built independently of
the fbdev device interface.

Signed-off-by: Melih Emik <melihemik@noirlang.tr>
---
 drivers/video/fbdev/Kconfig            | 1 -
 drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 085d3a202148..762c4369e00f 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1521,7 +1521,6 @@ config FB_SH_MOBILE_LCDC
 	tristate "SuperH Mobile LCDC framebuffer support"
 	depends on FB && HAVE_CLK && HAS_IOMEM
 	depends on SUPERH || COMPILE_TEST
-	depends on FB_DEVICE
 	depends on BACKLIGHT_CLASS_DEVICE
 	select FB_BACKLIGHT
 	select FB_DEFERRED_IO
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index 72969fe8e513..b522b76b402d 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -1511,7 +1511,7 @@ sh_mobile_lcdc_overlay_fb_unregister(struct sh_mobile_lcdc_overlay *ovl)
 {
 	struct fb_info *info = ovl->info;
 
-	if (info == NULL || info->dev == NULL)
+	if (!info || !refcount_read(&info->count))
 		return;
 
 	unregister_framebuffer(ovl->info);
@@ -1983,7 +1983,7 @@ static const struct fb_ops sh_mobile_lcdc_ops = {
 static void
 sh_mobile_lcdc_channel_fb_unregister(struct sh_mobile_lcdc_chan *ch)
 {
-	if (ch->info && ch->info->dev)
+	if (ch->info && refcount_read(&ch->info->count))
 		unregister_framebuffer(ch->info);
 }
 
@@ -2640,7 +2640,9 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
 static struct platform_driver sh_mobile_lcdc_driver = {
 	.driver		= {
 		.name		= "sh_mobile_lcdc_fb",
+#ifdef CONFIG_FB_DEVICE
 		.dev_groups	= overlay_sysfs_groups,
+#endif
 		.pm		= &sh_mobile_lcdc_dev_pm_ops,
 	},
 	.probe		= sh_mobile_lcdc_probe,
-- 
2.54.0


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

end of thread, other threads:[~2026-05-13  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-09 18:27 [PATCH] fbdev: make sh_mobile_lcdc independent of FB_DEVICE Melih Emik
2026-05-13  7:41 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox