Hi Ping-chung,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.18-rc4 next-20180709]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Ping-chung-Chen/media-imx208-Add-imx208-camera-sensor-driver/20180710-153546
base:   git://linuxtv.org/media_tree.git master
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/media/i2c/imx208.c:881:26: sparse: no member 'type' in struct 
media_entity
   drivers/media/i2c/imx208.c:885:15: sparse: undefined identifier 
'media_entity_init'
   drivers/media/i2c/imx208.c:881:26: sparse: generating address of non-lvalue 
(8)
   drivers/media/i2c/imx208.c:885:32: sparse: call with no type!
   drivers/media/i2c/imx208.c: In function 'imx208_probe':
>> drivers/media/i2c/imx208.c:881:20: error: 'struct media_entity' has no 
>> member named 'type'; did you mean 'pipe'?
     imx208->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
                       ^~~~
                       pipe
>> drivers/media/i2c/imx208.c:881:27: error: 'MEDIA_ENT_T_V4L2_SUBDEV_SENSOR' 
>> undeclared (first use in this function); did you mean 
>> 'MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN'?
     imx208->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                              MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
   drivers/media/i2c/imx208.c:881:27: note: each undeclared identifier is 
reported only once for each function it appears in
>> drivers/media/i2c/imx208.c:885:8: error: implicit declaration of function 
>> 'media_entity_init'; did you mean 'media_entity_put'? 
>> [-Werror=implicit-function-declaration]
     ret = media_entity_init(&imx208->sd.entity, 1, &imx208->pad, 0);
           ^~~~~~~~~~~~~~~~~
           media_entity_put
   cc1: some warnings being treated as errors

sparse warnings: (new ones prefixed by >>)

   drivers/media/i2c/imx208.c:881:26: sparse: no member 'type' in struct 
media_entity
   drivers/media/i2c/imx208.c:885:15: sparse: undefined identifier 
'media_entity_init'
>> drivers/media/i2c/imx208.c:881:26: sparse: generating address of non-lvalue 
>> (8)
>> drivers/media/i2c/imx208.c:885:32: sparse: call with no type!
   drivers/media/i2c/imx208.c: In function 'imx208_probe':
   drivers/media/i2c/imx208.c:881:20: error: 'struct media_entity' has no 
member named 'type'; did you mean 'pipe'?
     imx208->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
                       ^~~~
                       pipe
   drivers/media/i2c/imx208.c:881:27: error: 'MEDIA_ENT_T_V4L2_SUBDEV_SENSOR' 
undeclared (first use in this function); did you mean 
'MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN'?
     imx208->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                              MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
   drivers/media/i2c/imx208.c:881:27: note: each undeclared identifier is 
reported only once for each function it appears in
   drivers/media/i2c/imx208.c:885:8: error: implicit declaration of function 
'media_entity_init'; did you mean 'media_entity_put'? 
[-Werror=implicit-function-declaration]
     ret = media_entity_init(&imx208->sd.entity, 1, &imx208->pad, 0);
           ^~~~~~~~~~~~~~~~~
           media_entity_put
   cc1: some warnings being treated as errors

vim +881 drivers/media/i2c/imx208.c

   848  
   849  static int imx208_probe(struct i2c_client *client)
   850  {
   851          struct imx208 *imx208;
   852          int ret;
   853          u32 val = 0;
   854  
   855          device_property_read_u32(&client->dev, "clock-frequency", &val);
   856          if (val != 19200000)
   857                  return -EINVAL;
   858  
   859          imx208 = devm_kzalloc(&client->dev, sizeof(*imx208), 
GFP_KERNEL);
   860          if (!imx208)
   861                  return -ENOMEM;
   862  
   863          /* Initialize subdev */
   864          v4l2_i2c_subdev_init(&imx208->sd, client, &imx208_subdev_ops);
   865  
   866          /* Check module identity */
   867          ret = imx208_identify_module(imx208);
   868          if (ret)
   869                  return ret;
   870  
   871          /* Set default mode to max resolution */
   872          imx208->cur_mode = &supported_modes[0];
   873  
   874          ret = imx208_init_controls(imx208);
   875          if (ret)
   876                  return ret;
   877  
   878          /* Initialize subdev */
   879          imx208->sd.internal_ops = &imx208_internal_ops;
   880          imx208->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 > 881          imx208->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
   882  
   883          /* Initialize source pad */
   884          imx208->pad.flags = MEDIA_PAD_FL_SOURCE;
 > 885          ret = media_entity_init(&imx208->sd.entity, 1, &imx208->pad, 0);
   886          if (ret) {
   887                  dev_err(&client->dev, "%s failed:%d\n", __func__, ret);
   888                  goto error_handler_free;
   889          }
   890  
   891          ret = v4l2_async_register_subdev_sensor_common(&imx208->sd);
   892          if (ret < 0)
   893                  goto error_media_entity;
   894  
   895          pm_runtime_set_active(&client->dev);
   896          pm_runtime_enable(&client->dev);
   897          pm_runtime_idle(&client->dev);
   898  
   899          return 0;
   900  
   901  error_media_entity:
   902          media_entity_cleanup(&imx208->sd.entity);
   903  
   904  error_handler_free:
   905          imx208_free_controls(imx208);
   906  
   907          return ret;
   908  }
   909  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to