[sailus-media-tree:ipu6 40/50] drivers/media/v4l2-core/v4l2-common.c:512:9: error: implicit declaration of function 'v4l2_subdev_call_op' is invalid in C99

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://linuxtv.org/sailus/media_tree.git ipu6
head:   308898eb3af1c6530b122a01a5c4b38931717e70
commit: 68213f72d8c806ff6968fb30c4bf61fd1257c4a3 [40/50] media: v4l: Support obtaining link frequency via get_mbus_config
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240429/202404292239.nNxjfKs4-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240429/202404292239.nNxjfKs4-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404292239.nNxjfKs4-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/media/v4l2-core/v4l2-common.c:512:9: error: implicit declaration of function 'v4l2_subdev_call_op' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                   ret = v4l2_subdev_call_op(sd, pad, get_mbus_config,
                         ^
   drivers/media/v4l2-core/v4l2-common.c:512:9: note: did you mean 'v4l2_subdev_cleanup'?
   include/media/v4l2-subdev.h:1320:6: note: 'v4l2_subdev_cleanup' declared here
   void v4l2_subdev_cleanup(struct v4l2_subdev *sd);
        ^
   drivers/media/v4l2-core/v4l2-common.c:512:33: error: use of undeclared identifier 'pad'
                   ret = v4l2_subdev_call_op(sd, pad, get_mbus_config,
                                                 ^
   drivers/media/v4l2-core/v4l2-common.c:512:38: error: use of undeclared identifier 'get_mbus_config'
                   ret = v4l2_subdev_call_op(sd, pad, get_mbus_config,
                                                      ^
   drivers/media/v4l2-core/v4l2-common.c:522:19: error: use of undeclared identifier 'v4l2_get_link_freq'; did you mean '__v4l2_get_link_freq'?
   EXPORT_SYMBOL_GPL(v4l2_get_link_freq);
                     ^~~~~~~~~~~~~~~~~~
                     __v4l2_get_link_freq
   include/linux/export.h:69:48: note: expanded from macro 'EXPORT_SYMBOL_GPL'
   #define EXPORT_SYMBOL_GPL(sym)          _EXPORT_SYMBOL(sym, "GPL")
                                                          ^
   include/linux/export.h:65:54: note: expanded from macro '_EXPORT_SYMBOL'
   #define _EXPORT_SYMBOL(sym, license)    __EXPORT_SYMBOL(sym, license, "")
                                                           ^
   include/linux/export.h:56:16: note: expanded from macro '__EXPORT_SYMBOL'
           extern typeof(sym) sym;                                 \
                         ^
   drivers/media/v4l2-core/v4l2-common.c:467:5: note: '__v4l2_get_link_freq' declared here
   s64 __v4l2_get_link_freq(struct v4l2_subdev *sd,
       ^
   4 errors generated.


vim +/v4l2_subdev_call_op +512 drivers/media/v4l2-core/v4l2-common.c

   466	
   467	s64 __v4l2_get_link_freq(struct v4l2_subdev *sd,
   468				 struct v4l2_ctrl_handler *handler, unsigned int mul,
   469				 unsigned int div)
   470	{
   471		struct v4l2_ctrl *ctrl;
   472		s64 freq;
   473	
   474		if (!handler && sd)
   475			handler = sd->ctrl_handler;
   476	
   477		ctrl = v4l2_ctrl_find(handler, V4L2_CID_LINK_FREQ);
   478		if (ctrl) {
   479			struct v4l2_querymenu qm = { .id = V4L2_CID_LINK_FREQ };
   480			int ret;
   481	
   482			if (ctrl->type == V4L2_CTRL_TYPE_INTEGER64)
   483				return v4l2_ctrl_g_ctrl_int64(ctrl);
   484	
   485			qm.index = v4l2_ctrl_g_ctrl(ctrl);
   486	
   487			ret = v4l2_querymenu(handler, &qm);
   488			if (ret)
   489				return -ENOENT;
   490	
   491			freq = qm.value;
   492		} else {
   493			if (!mul || !div)
   494				return -ENOENT;
   495	
   496			ctrl = v4l2_ctrl_find(handler, V4L2_CID_PIXEL_RATE);
   497			if (!ctrl)
   498				return -ENOENT;
   499	
   500			freq = div_u64(v4l2_ctrl_g_ctrl_int64(ctrl) * mul, div);
   501	
   502			pr_warn("%s: Link frequency estimated using pixel rate: result might be inaccurate\n",
   503				__func__);
   504			pr_warn("%s: Consider implementing support for V4L2_CID_LINK_FREQ in the transmitter driver\n",
   505				__func__);
   506		}
   507	
   508		if (freq <= 0 && sd) {
   509			struct v4l2_mbus_config mbus_config = {};
   510			int ret;
   511	
 > 512			ret = v4l2_subdev_call_op(sd, pad, get_mbus_config,
   513						  &mbus_config);
   514			if (ret < 0)
   515				return ret;
   516	
   517			return mbus_config.link_freq;
   518		}
   519	
   520		return freq > 0 ? freq : -EINVAL;
   521	}
   522	EXPORT_SYMBOL_GPL(v4l2_get_link_freq);
   523	

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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux