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

* Re: [PATCH] fbdev: make sh_mobile_lcdc independent of FB_DEVICE
  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
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-13  7:41 UTC (permalink / raw)
  To: Melih Emik, Helge Deller, linux-fbdev, dri-devel
  Cc: oe-kbuild-all, Thomas Zimmermann, Wei Liu, Prasanna Kumar T S M,
	Zsolt Kajtar, Mukesh Rathor, linux-kernel

Hi Melih,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm-tip/drm-tip linus/master v7.1-rc3 next-20260508]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Melih-Emik/fbdev-make-sh_mobile_lcdc-independent-of-FB_DEVICE/20260512-235223
base:   https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link:    https://lore.kernel.org/r/20260509213041.BqkXfeyP%4066089470-6549-4c3e-ae4b-211f3f79ee1e
patch subject: [PATCH] fbdev: make sh_mobile_lcdc independent of FB_DEVICE
config: powerpc64-randconfig-r111-20260513 (https://download.01.org/0day-ci/archive/20260513/202605131530.ZsNIZEco-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260513/202605131530.ZsNIZEco-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605131530.ZsNIZEco-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/backlight.h:12,
                    from drivers/video/fbdev/sh_mobile_lcdcfb.c:12:
   drivers/video/fbdev/sh_mobile_lcdcfb.c: In function 'sh_mobile_lcdc_release':
>> drivers/video/fbdev/sh_mobile_lcdcfb.c:1787:14: error: 'struct fb_info' has no member named 'dev'
     dev_dbg(info->dev, "%s(): %d users\n", __func__, ch->use_count);
                 ^~
   include/linux/dev_printk.h:139:23: note: in definition of macro 'dev_no_printk'
       _dev_printk(level, dev, fmt, ##__VA_ARGS__); \
                          ^~~
   drivers/video/fbdev/sh_mobile_lcdcfb.c:1787:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(info->dev, "%s(): %d users\n", __func__, ch->use_count);
     ^~~~~~~
   drivers/video/fbdev/sh_mobile_lcdcfb.c: In function 'sh_mobile_lcdc_open':
   drivers/video/fbdev/sh_mobile_lcdcfb.c:1810:14: error: 'struct fb_info' has no member named 'dev'
     dev_dbg(info->dev, "%s(): %d users\n", __func__, ch->use_count);
                 ^~
   include/linux/dev_printk.h:139:23: note: in definition of macro 'dev_no_printk'
       _dev_printk(level, dev, fmt, ##__VA_ARGS__); \
                          ^~~
   drivers/video/fbdev/sh_mobile_lcdcfb.c:1810:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(info->dev, "%s(): %d users\n", __func__, ch->use_count);
     ^~~~~~~
   drivers/video/fbdev/sh_mobile_lcdcfb.c: In function 'sh_mobile_lcdc_set_par':
   drivers/video/fbdev/sh_mobile_lcdcfb.c:1894:15: error: 'struct fb_info' has no member named 'dev'
      dev_err(info->dev, "%s: unable to restart LCDC\n", __func__);
                  ^~
   include/linux/dev_printk.h:110:11: note: in definition of macro 'dev_printk_index_wrap'
      _p_func(dev, fmt, ##__VA_ARGS__);   \
              ^~~
   drivers/video/fbdev/sh_mobile_lcdcfb.c:1894:3: note: in expansion of macro 'dev_err'
      dev_err(info->dev, "%s: unable to restart LCDC\n", __func__);
      ^~~~~~~


vim +1787 drivers/video/fbdev/sh_mobile_lcdcfb.c

dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1777  
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1778  /*
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1779   * Locking: both .fb_release() and .fb_open() are called with info->lock held if
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1780   * user == 1, or with console sem held, if user == 0.
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1781   */
d7ad3342186330 drivers/video/sh_mobile_lcdcfb.c Laurent Pinchart      2011-11-22  1782  static int sh_mobile_lcdc_release(struct fb_info *info, int user)
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1783  {
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1784  	struct sh_mobile_lcdc_chan *ch = info->par;
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1785  
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1786  	mutex_lock(&ch->open_lock);
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14 @1787  	dev_dbg(info->dev, "%s(): %d users\n", __func__, ch->use_count);
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1788  
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1789  	ch->use_count--;
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1790  
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1791  	/* Nothing to reconfigure, when called from fbcon */
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1792  	if (user) {
ac751efa6a0d70 drivers/video/sh_mobile_lcdcfb.c Torben Hohn           2011-01-25  1793  		console_lock();
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1794  		sh_mobile_fb_reconfig(info);
ac751efa6a0d70 drivers/video/sh_mobile_lcdcfb.c Torben Hohn           2011-01-25  1795  		console_unlock();
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1796  	}
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1797  
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1798  	mutex_unlock(&ch->open_lock);
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1799  
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1800  	return 0;
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1801  }
dd210503b77ae0 drivers/video/sh_mobile_lcdcfb.c Guennadi Liakhovetski 2010-09-14  1802  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[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