Skip to content

Commit be26a07

Browse files
nehudesihdeller
authored andcommitted
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: a06d03f ("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>
1 parent cbfb9c7 commit be26a07

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

drivers/staging/fbtft/fbtft-core.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,
365365
unsigned int val;
366366
int ret = 1;
367367

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);
371371

372372
switch (info->fix.visual) {
373373
case FB_VISUAL_TRUECOLOR:
@@ -391,8 +391,7 @@ static int fbtft_fb_blank(int blank, struct fb_info *info)
391391
struct fbtft_par *par = info->par;
392392
int ret = -EINVAL;
393393

394-
dev_dbg(info->dev, "%s(blank=%d)\n",
395-
__func__, blank);
394+
fb_dbg(info, "blank=%d\n", blank);
396395

397396
if (!par->fbtftops.blank)
398397
return ret;
@@ -793,11 +792,11 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)
793792
if (spi)
794793
sprintf(text2, ", spi%d.%d at %d MHz", spi->controller->bus_num,
795794
spi_get_chipselect(spi, 0), spi->max_speed_hz / 1000000);
796-
dev_info(fb_info->dev,
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);
795+
fb_info(fb_info,
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);
801800

802801
/* Turn on backlight if available */
803802
if (fb_info->bl_dev) {

0 commit comments

Comments
 (0)