staging: fbtft: use dev_of_fbinfo() instead of info->dev
Subsystems (3)
PATCH v5 1/1 staging: fbtft: use dev_of_fbinfo() instead of info->dev
This fixes commita06d03f9f238 ("staging: fbtft: Make FB_DEVICE dependency optional")
from my previous v4 series:
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/
All direct accesses to info->dev or fb_info->dev are replaced with dev_of_fbinfo() helper, improving readability and ensuring compilation succeeds when CONFIG_FB_DEVICE=n.
--- drivers/staging/fbtft/fbtft-core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fbtft-core.c +6 -3
@@ -364,8 +364,9 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, {unsigned int val;int ret =1 ; +struct device *dev =dev_of_fbinfo (info); -dev_dbg (info->dev, +dev_dbg (dev,"%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n" , __func__, regno, red, green, blue, transp);
@@ -389,9 +390,10 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,static int fbtft_fb_blank (int blank,struct fb_info *info) {struct fbtft_par *par = info->par; +struct device *dev =dev_of_fbinfo (info);int ret = -EINVAL ; -dev_dbg (info->dev,"%s(blank=%d)\n" , +dev_dbg (dev,"%s(blank=%d)\n" , __func__, blank);if (!par->fbtftops.blank)
@@ -739,6 +741,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)char text2[50 ] ="" ;struct fbtft_par *par = fb_info->par;struct spi_device *spi = par->spi; +struct device *dev =dev_of_fbinfo (fb_info);/* sanity checks */ if (!par->fbtftops.init_display) {
@@ -793,7 +796,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)if (spi)sprintf (text2,", spi%d.%d at %d MHz" , spi->controller->bus_num,spi_get_chipselect (spi,0 ), spi->max_speed_hz /1000000 ); - dev_info(fb_info->dev, + dev_info(dev, "%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n", fb_info->fix.id, fb_info->var.xres, fb_info->var.yres, fb_info->fix.smem_len >> 10, text1,
Signature · 1 line
2.43.0
Greg KH
maintainerQuoted 64 lines · Chintan Patel
This fixes commit
a06d03f9f238("staging: fbtft: MakeFB_DEVICEdependency optional")from my previous v4 series:
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/All direct accesses to
info->devorfb_info->devare replaced withdev_of_fbinfo()helper, improving readability and ensuring compilation succeeds whenCONFIG_FB_DEVICE=n.Reported-by kernel test robot <[email protected]>Signed-off-by Chintan Patel <[email protected]>--- drivers/staging/fbtft/fbtft-core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/fbtft/fbtft-core.c +6
-3@@ -364,8 +364,9 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, {unsigned int val;int ret =1 ; +struct device *dev =dev_of_fbinfo (info); -dev_dbg (info->dev, +dev_dbg (dev,"%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n" , __func__, regno, red, green, blue, transp);@@ -389,9 +390,10 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,static int fbtft_fb_blank (int blank,struct fb_info *info) {struct fbtft_par *par = info->par; +struct device *dev =dev_of_fbinfo (info);int ret = -EINVAL ; -dev_dbg (info->dev,"%s(blank=%d)\n" , +dev_dbg (dev,"%s(blank=%d)\n" , __func__, blank);if (!par->fbtftops.blank)@@ -739,6 +741,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)char text2[50 ] ="" ;struct fbtft_par *par = fb_info->par;struct spi_device *spi = par->spi; +struct device *dev =dev_of_fbinfo (fb_info);/* sanity checks */ if (!par->fbtftops.init_display) {@@ -793,7 +796,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)if (spi)sprintf (text2,", spi%d.%d at %d MHz" , spi->controller->bus_num,spi_get_chipselect (spi,0 ), spi->max_speed_hz /1000000 ); - dev_info(fb_info->dev, + dev_info(dev, "%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n", fb_info->fix.id, fb_info->var.xres, fb_info->var.yres, fb_info->fix.smem_len >> 10, text1,Signature · 1 line
2.43.0
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot
Quoted 2 lines · Chintan Patel
This fixes commit
a06d03f9f238("staging: fbtft: MakeFB_DEVICEdependency optional")
Convert to be as Fixes tag instead.
Quoted 2 lines
from my previous v4 series:
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/
This is unneeded churn in the commit message, also this patch wrongly marked as v5 that triggered Greg's bot response. You had to number it as v1, but now please, address the above and below comments and make it v6 with a Changelog added (explaining changes in v5 and in v6).
Quoted 3 lines
All direct accesses to
info->devorfb_info->devare replaced withdev_of_fbinfo()helper, improving readability and ensuring compilation succeeds whenCONFIG_FB_DEVICE=n.
...
drivers/staging/fbtft/fbtft-core.c static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, · line 367
Quoted 5 lines
drivers/staging/fbtft/fbtft-core.c +1
-0@@ -364,8 +364,9 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, {unsigned int val;int ret =1 ; +struct device *dev =dev_of_fbinfo (info);
Try to keep it in reversed xmas tree order.
...
drivers/staging/fbtft/fbtft-core.c static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, · line 394
Quoted 5 lines
drivers/staging/fbtft/fbtft-core.c +1
-0static int fbtft_fb_blank (int blank,struct fb_info *info) {struct fbtft_par *par = info->par; +struct device *dev =dev_of_fbinfo (info);int ret = -EINVAL ;
Ditto.
drivers/staging/fbtft/fbtft-core.c static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, · line 397
Quoted 3 lines
drivers/staging/fbtft/fbtft-core.c +1
-1-dev_dbg (info->dev,"%s(blank=%d)\n" , +dev_dbg (dev,"%s(blank=%d)\n" , __func__, blank);
Since you are changing it anyway, make it one line.
...
drivers/staging/fbtft/fbtft-core.c int fbtft_register_framebuffer(struct fb_info *fb_info) · line 744
Quoted 5 lines
drivers/staging/fbtft/fbtft-core.c +1
-0@@ -739,6 +741,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)char text2[50 ] ="" ;struct fbtft_par *par = fb_info->par;struct spi_device *spi = par->spi; +struct device *dev =dev_of_fbinfo (fb_info);
Reversed xmas tree order (as much as it's possible with this added line).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg KH
maintainerQuoted 6 lines · Andy Shevchenko
drivers/staging/fbtft/fbtft-core.c static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, · line 397
Quoted 3 lines · Chintan Patel
drivers/staging/fbtft/fbtft-core.c +1
-1-dev_dbg (info->dev,"%s(blank=%d)\n" , +dev_dbg (dev,"%s(blank=%d)\n" , __func__, blank);Since you are changing it anyway, make it one line.
Wait, why would dev_dbg() ever had __func__ added to it? That's automatically included in the output if the user wants it, please do not duplicate it again.
thanks,
greg k-h
Hi
Am 12.01.26 um 02:07 schrieb Chintan Patel:
Quoted 22 lines
This fixes commit
a06d03f9f238("staging: fbtft: MakeFB_DEVICEdependency optional")from my previous v4 series:
https://patchwork.kernel.org/project/dri-devel/cover/[email protected]/All direct accesses to
info->devorfb_info->devare replaced withdev_of_fbinfo()helper, improving readability and ensuring compilation succeeds whenCONFIG_FB_DEVICE=n.Reported-by kernel test robot <[email protected]>Signed-off-by Chintan Patel <[email protected]>--- drivers/staging/fbtft/fbtft-core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/fbtft/fbtft-core.c +0
-0
drivers/staging/fbtft/fbtft-core.c static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, · line 371
Quoted 9 lines
drivers/staging/fbtft/fbtft-core.c +2
-1@@ -364,8 +364,9 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red, {unsigned int val;int ret =1 ; +struct device *dev =dev_of_fbinfo (info); -dev_dbg (info->dev, +dev_dbg (dev,"%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n" , __func__, regno, red, green, blue, transp);
Rather use fb_dbg() from <linux/fb.h>. It will format the output appropriately.
Quoted 22 lines
drivers/staging/fbtft/fbtft-core.c +3
-1@@ -389,9 +390,10 @@ static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,static int fbtft_fb_blank (int blank,struct fb_info *info) {struct fbtft_par *par = info->par; +struct device *dev =dev_of_fbinfo (info);int ret = -EINVAL ; -dev_dbg (info->dev,"%s(blank=%d)\n" , +dev_dbg (dev,"%s(blank=%d)\n" , __func__, blank);if (!par->fbtftops.blank)@@ -739,6 +741,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)char text2[50 ] ="" ;struct fbtft_par *par = fb_info->par;struct spi_device *spi = par->spi; +struct device *dev =dev_of_fbinfo (fb_info);/* sanity checks */ if (!par->fbtftops.init_display) {
drivers/staging/fbtft/fbtft-core.c int fbtft_register_framebuffer(struct fb_info *fb_info) · line 799
Quoted 5 lines
drivers/staging/fbtft/fbtft-core.c +1
-1@@ -793,7 +796,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)if (spi)sprintf (text2,", spi%d.%d at %d MHz" , spi->controller->bus_num,spi_get_chipselect (spi,0 ), spi->max_speed_hz /1000000 ); - dev_info(fb_info->dev, + dev_info(dev,
fb_info() here.
Best regards
Thomas
Quoted 3 lines
drivers/staging/fbtft/fbtft-core.c +0
-0"%s frame buffer, %dx%d, %d KiB video memory%s, fps=%lu%s\n" , fb_info->fix.id, fb_info->var.xres, fb_info->var.yres, fb_info->fix.smem_len >> 10, text1,
Signature · 6 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Chintan,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Chintan-Patel/staging-fbtft-use-dev_of_fbinfo-instead-of-info-dev/20260112-091221 base: staging/staging-testing patch link: https://lore.kernel.org/r/20260112010740.186248-1-chintanlike%40gmail.com patch subject: [PATCH v5] staging: fbtft: use dev_of_fbinfo() instead of info->dev config: x86_64-randconfig-005-20260112 (https://download.01.org/0day-ci/archive/20260112/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) rustc: rustc 1.88.0 (6b00bc388 2025-06-23) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260112/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/staging/fbtft/fbtft-core.c:367:23: error: call to undeclared function 'dev_of_fbinfo'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
367 | struct device *dev = dev_of_fbinfo(info);
| ^
>> drivers/staging/fbtft/fbtft-core.c:367:17: error: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion]
367 | struct device *dev = dev_of_fbinfo(info);
| ^ ~~~~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft-core.c:393:23: error: call to undeclared function 'dev_of_fbinfo'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
393 | struct device *dev = dev_of_fbinfo(info);
| ^
drivers/staging/fbtft/fbtft-core.c:393:17: error: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion]
393 | struct device *dev = dev_of_fbinfo(info);
| ^ ~~~~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fbtft-core.c:744:23: error: call to undeclared function 'dev_of_fbinfo'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
744 | struct device *dev = dev_of_fbinfo(fb_info);
| ^
drivers/staging/fbtft/fbtft-core.c:744:17: error: incompatible integer to pointer conversion initializing 'struct device *' with an expression of type 'int' [-Wint-conversion]
744 | struct device *dev = dev_of_fbinfo(fb_info);
| ^ ~~~~~~~~~~~~~~~~~~~~~~6 errors generated.
vim +/dev_of_fbinfo +367 drivers/staging/fbtft/fbtft-core.c
360
361 static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,
362 unsigned int green, unsigned int blue,
363 unsigned int transp, struct fb_info *info)
364 {
365 unsigned int val;
366 int ret = 1;
> 367 struct device *dev = dev_of_fbinfo(info);
368
369 dev_dbg(dev,
370 "%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n",
371 __func__, regno, red, green, blue, transp);
372
373 switch (info->fix.visual) {
374 case FB_VISUAL_TRUECOLOR:
375 if (regno < 16) {
376 u32 *pal = info->pseudo_palette;
377
378 val = chan_to_field(red, &info->var.red);
379 val |= chan_to_field(green, &info->var.green);
380 val |= chan_to_field(blue, &info->var.blue);
381
382 pal[regno] = val;
383 ret = 0;
384 }
385 break;
386 }
387 return ret;
388 }
389
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Chintan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Chintan-Patel/staging-fbtft-use-dev_of_fbinfo-instead-of-info-dev/20260112-091221 base: staging/staging-testing patch link: https://lore.kernel.org/r/20260112010740.186248-1-chintanlike%40gmail.com patch subject: [PATCH v5] staging: fbtft: use dev_of_fbinfo() instead of info->dev config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20260113/[email protected]/config) compiler: nios2-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/staging/fbtft/fbtft-core.c: In function 'fbtft_fb_setcolreg':
drivers/staging/fbtft/fbtft-core.c:367:30: error: implicit declaration of function 'dev_of_fbinfo'; did you mean 'dev_info'? [-Werror=implicit-function-declaration]
367 | struct device *dev = dev_of_fbinfo(info);
| ^~~~~~~~~~~~~
| dev_info
>> drivers/staging/fbtft/fbtft-core.c:367:30: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/staging/fbtft/fbtft-core.c: In function 'fbtft_fb_blank':
drivers/staging/fbtft/fbtft-core.c:393:30: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
393 | struct device *dev = dev_of_fbinfo(info);
| ^~~~~~~~~~~~~
drivers/staging/fbtft/fbtft-core.c: In function 'fbtft_register_framebuffer':
drivers/staging/fbtft/fbtft-core.c:744:30: warning: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
744 | struct device *dev = dev_of_fbinfo(fb_info);
| ^~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +367 drivers/staging/fbtft/fbtft-core.c
360
361 static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,
362 unsigned int green, unsigned int blue,
363 unsigned int transp, struct fb_info *info)
364 {
365 unsigned int val;
366 int ret = 1;
> 367 struct device *dev = dev_of_fbinfo(info);
368
369 dev_dbg(dev,
370 "%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n",
371 __func__, regno, red, green, blue, transp);
372
373 switch (info->fix.visual) {
374 case FB_VISUAL_TRUECOLOR:
375 if (regno < 16) {
376 u32 *pal = info->pseudo_palette;
377
378 val = chan_to_field(red, &info->var.red);
379 val |= chan_to_field(green, &info->var.green);
380 val |= chan_to_field(blue, &info->var.blue);
381
382 pal[regno] = val;
383 ret = 0;
384 }
385 break;
386 }
387 return ret;
388 }
389
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Chintan,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Chintan-Patel/staging-fbtft-use-dev_of_fbinfo-instead-of-info-dev/20260112-091221 base: staging/staging-testing patch link: https://lore.kernel.org/r/20260112010740.186248-1-chintanlike%40gmail.com patch subject: [PATCH v5] staging: fbtft: use dev_of_fbinfo() instead of info->dev config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260113/[email protected]/config) compiler: sh4-linux-gcc (GCC) 15.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/staging/fbtft/fbtft-core.c: In function 'fbtft_fb_setcolreg':
>> drivers/staging/fbtft/fbtft-core.c:367:30: error: implicit declaration of function 'dev_of_fbinfo'; did you mean 'dev_info'? [-Wimplicit-function-declaration]
367 | struct device *dev = dev_of_fbinfo(info);
| ^~~~~~~~~~~~~
| dev_info
>> drivers/staging/fbtft/fbtft-core.c:367:30: error: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/staging/fbtft/fbtft-core.c: In function 'fbtft_fb_blank':
drivers/staging/fbtft/fbtft-core.c:393:30: error: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
393 | struct device *dev = dev_of_fbinfo(info);
| ^~~~~~~~~~~~~
drivers/staging/fbtft/fbtft-core.c: In function 'fbtft_register_framebuffer':
drivers/staging/fbtft/fbtft-core.c:744:30: error: initialization of 'struct device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
744 | struct device *dev = dev_of_fbinfo(fb_info);
| ^~~~~~~~~~~~~vim +367 drivers/staging/fbtft/fbtft-core.c
360
361 static int fbtft_fb_setcolreg(unsigned int regno, unsigned int red,
362 unsigned int green, unsigned int blue,
363 unsigned int transp, struct fb_info *info)
364 {
365 unsigned int val;
366 int ret = 1;
> 367 struct device *dev = dev_of_fbinfo(info);
368
369 dev_dbg(dev,
370 "%s(regno=%u, red=0x%X, green=0x%X, blue=0x%X, trans=0x%X)\n",
371 __func__, regno, red, green, blue, transp);
372
373 switch (info->fix.visual) {
374 case FB_VISUAL_TRUECOLOR:
375 if (regno < 16) {
376 u32 *pal = info->pseudo_palette;
377
378 val = chan_to_field(red, &info->var.red);
379 val |= chan_to_field(green, &info->var.green);
380 val |= chan_to_field(blue, &info->var.blue);
381
382 pal[regno] = val;
383 ret = 0;
384 }
385 break;
386 }
387 return ret;
388 }
389
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki