[PATCH 2/7] fbdev: Do not include <linux/backlight.h> in header
kernel test robot
lkp at intel.com
Mon Feb 12 19:25:43 UTC 2024
Hi Thomas,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v6.8-rc4 next-20240212]
[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/Thomas-Zimmermann/drm-nouveau-Include-linux-backlight-h/20240212-181930
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20240212101712.23675-3-tzimmermann%40suse.de
patch subject: [PATCH 2/7] fbdev: Do not include <linux/backlight.h> in header
config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20240213/202402130207.8ZFxCEYs-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240213/202402130207.8ZFxCEYs-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402130207.8ZFxCEYs-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/staging/fbtft/fb_ssd1351.c: In function 'update_onboard_backlight':
drivers/staging/fbtft/fb_ssd1351.c:192:33: error: implicit declaration of function 'bl_get_data'; did you mean 'acpi_get_data'? [-Werror=implicit-function-declaration]
192 | struct fbtft_par *par = bl_get_data(bd);
| ^~~~~~~~~~~
| acpi_get_data
>> drivers/staging/fbtft/fb_ssd1351.c:192:33: warning: initialization of 'struct fbtft_par *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
In file included from include/linux/device.h:15,
from include/linux/acpi.h:14,
from include/linux/spi/spi.h:9,
from drivers/staging/fbtft/fb_ssd1351.c:5:
drivers/staging/fbtft/fb_ssd1351.c:197:35: error: invalid use of undefined type 'struct backlight_device'
197 | __func__, bd->props.power, bd->props.fb_blank);
| ^~
include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:433:17: note: in expansion of macro 'dev_info'
433 | dev_info((par)->info->device, format, ##arg); \
| ^~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:195:9: note: in expansion of macro 'fbtft_par_dbg'
195 | fbtft_par_dbg(DEBUG_BACKLIGHT, par,
| ^~~~~~~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:197:52: error: invalid use of undefined type 'struct backlight_device'
197 | __func__, bd->props.power, bd->props.fb_blank);
| ^~
include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/staging/fbtft/fbtft.h:433:17: note: in expansion of macro 'dev_info'
433 | dev_info((par)->info->device, format, ##arg); \
| ^~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:195:9: note: in expansion of macro 'fbtft_par_dbg'
195 | fbtft_par_dbg(DEBUG_BACKLIGHT, par,
| ^~~~~~~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:199:15: error: implicit declaration of function 'backlight_is_blank' [-Werror=implicit-function-declaration]
199 | on = !backlight_is_blank(bd);
| ^~~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c: At top level:
drivers/staging/fbtft/fb_ssd1351.c:206:21: error: variable 'bl_ops' has initializer but incomplete type
206 | static const struct backlight_ops bl_ops = {
| ^~~~~~~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:207:10: error: 'const struct backlight_ops' has no member named 'update_status'
207 | .update_status = update_onboard_backlight,
| ^~~~~~~~~~~~~
>> drivers/staging/fbtft/fb_ssd1351.c:207:26: warning: excess elements in struct initializer
207 | .update_status = update_onboard_backlight,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:207:26: note: (near initialization for 'bl_ops')
drivers/staging/fbtft/fb_ssd1351.c: In function 'register_onboard_backlight':
drivers/staging/fbtft/fb_ssd1351.c:213:16: error: variable 'bl_props' has initializer but incomplete type
213 | struct backlight_properties bl_props = { 0, };
| ^~~~~~~~~~~~~~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:213:50: warning: excess elements in struct initializer
213 | struct backlight_properties bl_props = { 0, };
| ^
drivers/staging/fbtft/fb_ssd1351.c:213:50: note: (near initialization for 'bl_props')
drivers/staging/fbtft/fb_ssd1351.c:213:37: error: storage size of 'bl_props' isn't known
213 | struct backlight_properties bl_props = { 0, };
| ^~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c:215:25: error: 'BACKLIGHT_RAW' undeclared (first use in this function); did you mean 'FB_BACKLIGHT_MAX'?
215 | bl_props.type = BACKLIGHT_RAW;
| ^~~~~~~~~~~~~
| FB_BACKLIGHT_MAX
drivers/staging/fbtft/fb_ssd1351.c:215:25: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/fbtft/fb_ssd1351.c:218:14: error: implicit declaration of function 'backlight_device_register'; did you mean 'root_device_register'? [-Werror=implicit-function-declaration]
218 | bd = backlight_device_register(dev_driver_string(par->info->device),
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| root_device_register
>> drivers/staging/fbtft/fb_ssd1351.c:213:37: warning: unused variable 'bl_props' [-Wunused-variable]
213 | struct backlight_properties bl_props = { 0, };
| ^~~~~~~~
drivers/staging/fbtft/fb_ssd1351.c: At top level:
drivers/staging/fbtft/fb_ssd1351.c:206:35: error: storage size of 'bl_ops' isn't known
206 | static const struct backlight_ops bl_ops = {
| ^~~~~~
cc1: some warnings being treated as errors
vim +192 drivers/staging/fbtft/fb_ssd1351.c
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 189
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 190 static int update_onboard_backlight(struct backlight_device *bd)
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 191 {
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 @192 struct fbtft_par *par = bl_get_data(bd);
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 193 bool on;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 194
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 195 fbtft_par_dbg(DEBUG_BACKLIGHT, par,
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 196 "%s: power=%d, fb_blank=%d\n",
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 197 __func__, bd->props.power, bd->props.fb_blank);
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 198
66d653c37228cb Stephen Kitt 2022-06-07 199 on = !backlight_is_blank(bd);
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 200 /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 201 write_reg(par, 0xB5, on ? 0x03 : 0x02);
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 202
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 203 return 0;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 204 }
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 205
23801e3438f6ce Mike Rapoport 2015-09-03 @206 static const struct backlight_ops bl_ops = {
23801e3438f6ce Mike Rapoport 2015-09-03 @207 .update_status = update_onboard_backlight,
23801e3438f6ce Mike Rapoport 2015-09-03 208 };
23801e3438f6ce Mike Rapoport 2015-09-03 209
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 210 static void register_onboard_backlight(struct fbtft_par *par)
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 211 {
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 212 struct backlight_device *bd;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 @213 struct backlight_properties bl_props = { 0, };
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 214
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 @215 bl_props.type = BACKLIGHT_RAW;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 216 bl_props.power = FB_BLANK_POWERDOWN;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 217
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 218 bd = backlight_device_register(dev_driver_string(par->info->device),
333c7b940526be Leonardo Brás 2018-08-07 219 par->info->device, par, &bl_ops,
333c7b940526be Leonardo Brás 2018-08-07 220 &bl_props);
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 221 if (IS_ERR(bd)) {
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 222 dev_err(par->info->device,
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 223 "cannot register backlight device (%ld)\n",
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 224 PTR_ERR(bd));
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 225 return;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 226 }
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 227 par->info->bl_dev = bd;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 228
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 229 if (!par->fbtftops.unregister_backlight)
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 230 par->fbtftops.unregister_backlight = fbtft_unregister_backlight;
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 231 }
883daf0a5c35c8 Thomas Petazzoni 2014-12-31 232
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the dri-devel
mailing list