Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

staging: fbtft: Fix build failure when CONFIG_FB_DEVICE=n

When CONFIG_FB_DEVICE is disabled, struct fb_info does
not provide a valid dev pointer. Direct dereferences of
fb_info->dev therefore result in build failures.

Fix this by avoiding direct accesses to fb_info->dev and
switching the affected debug logging to framebuffer helpers
that do not rely on a device pointer.

This fixes the following build failure reported by the
kernel test robot.

Fixes: a06d03f9f238 ("staging: fbtft: Make FB_DEVICE dependency optional")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601110740.Y9XK5HtN-lkp@intel.com
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Chintan Patel <chintanlike@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Chintan Patel and committed by
Helge Deller
be26a07c cbfb9c71

+9 -10
+9 -10
drivers/staging/fbtft/fbtft-core.c
··· 365 365 unsigned int val; 366 366 int ret = 1; 367 367 368 - dev_dbg(info->dev, 369 - "%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n", 370 - __func__, regno, red, green, blue, transp); 368 + fb_dbg(info, 369 + "regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X\n", 370 + regno, red, green, blue, transp); 371 371 372 372 switch (info->fix.visual) { 373 373 case FB_VISUAL_TRUECOLOR: ··· 391 391 struct fbtft_par *par = info->par; 392 392 int ret = -EINVAL; 393 393 394 - dev_dbg(info->dev, "%s(blank=%d)\n", 395 - __func__, blank); 394 + fb_dbg(info, "blank=%d\n", blank); 396 395 397 396 if (!par->fbtftops.blank) 398 397 return ret; ··· 792 793 if (spi) 793 794 sprintf(text2, ", spi%d.%d at %d MHz", spi->controller->bus_num, 794 795 spi_get_chipselect(spi, 0), spi->max_speed_hz / 1000000); 795 - dev_info(fb_info->dev, 796 - "%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n", 797 - fb_info->fix.id, fb_info->var.xres, fb_info->var.yres, 798 - fb_info->fix.smem_len >> 10, text1, 799 - HZ / fb_info->fbdefio->delay, text2); 796 + fb_info(fb_info, 797 + "%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n", 798 + fb_info->fix.id, fb_info->var.xres, fb_info->var.yres, 799 + fb_info->fix.smem_len >> 10, text1, 800 + HZ / fb_info->fbdefio->delay, text2); 800 801 801 802 /* Turn on backlight if available */ 802 803 if (fb_info->bl_dev) {