Re: [PATCH] media: s5k4ecgx: Switch to GPIO descriptors

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

 



Hi Linus,

I love your patch! Perhaps something to improve:

[auto build test WARNING on media-tree/master]
[also build test WARNING on v5.18 next-20220531]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Linus-Walleij/media-s5k4ecgx-Switch-to-GPIO-descriptors/20220531-164948
base:   git://linuxtv.org/media_tree.git master
config: i386-randconfig-a001 (https://download.01.org/0day-ci/archive/20220601/202206010746.udUX5CYK-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/d6a5013d9dd546a9c9d7ed3714e861f7593b1635
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Linus-Walleij/media-s5k4ecgx-Switch-to-GPIO-descriptors/20220531-164948
        git checkout d6a5013d9dd546a9c9d7ed3714e861f7593b1635
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/media/i2c/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/media/i2c/s5k4ecgx.c: In function 's5k4ecgx_probe':
>> drivers/media/i2c/s5k4ecgx.c:897:45: warning: missing terminating " character
     897 |         gpiod_set_consumer_name(priv->stby, "S5K4ECGX_STBY);
         |                                             ^
   drivers/media/i2c/s5k4ecgx.c:897:45: error: missing terminating " character
     897 |         gpiod_set_consumer_name(priv->stby, "S5K4ECGX_STBY);
         |                                             ^~~~~~~~~~~~~~~~
   drivers/media/i2c/s5k4ecgx.c:898:76: error: expected ')' before ';' token
     898 |         priv->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
         |                                                                            ^
         |                                                                            )
   drivers/media/i2c/s5k4ecgx.c:897:32: note: to match this '('
     897 |         gpiod_set_consumer_name(priv->stby, "S5K4ECGX_STBY);
         |                                ^
   drivers/media/i2c/s5k4ecgx.c:898:21: error: passing argument 2 of 'gpiod_set_consumer_name' from incompatible pointer type [-Werror=incompatible-pointer-types]
     898 |         priv->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
         |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                     |
         |                     struct gpio_desc *
   In file included from drivers/media/i2c/s5k4ecgx.c:18:
   include/linux/gpio/consumer.h:166:65: note: expected 'const char *' but argument is of type 'struct gpio_desc *'
     166 | int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
         |                                                     ~~~~~~~~~~~~^~~~
   drivers/media/i2c/s5k4ecgx.c:927:20: error: expected ';' before '}' token
     927 |         return ret;
         |                    ^
         |                    ;
     928 | }
         | ~                   
   drivers/media/i2c/s5k4ecgx.c:895:17: error: label 'out_err' used but not defined
     895 |                 goto out_err;
         |                 ^~~~
>> drivers/media/i2c/s5k4ecgx.c:860:18: warning: unused variable 'i' [-Wunused-variable]
     860 |         int ret, i;
         |                  ^
   drivers/media/i2c/s5k4ecgx.c:928:1: error: control reaches end of non-void function [-Werror=return-type]
     928 | }
         | ^
   At top level:
   drivers/media/i2c/s5k4ecgx.c:827:12: warning: 's5k4ecgx_init_v4l2_ctrls' defined but not used [-Wunused-function]
     827 | static int s5k4ecgx_init_v4l2_ctrls(struct s5k4ecgx *priv)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +897 drivers/media/i2c/s5k4ecgx.c

   853	
   854	static int s5k4ecgx_probe(struct i2c_client *client,
   855				  const struct i2c_device_id *id)
   856	{
   857		struct s5k4ecgx_platform_data *pdata = client->dev.platform_data;
   858		struct v4l2_subdev *sd;
   859		struct s5k4ecgx *priv;
 > 860		int ret, i;
   861	
   862		if (pdata == NULL) {
   863			dev_err(&client->dev, "platform data is missing!\n");
   864			return -EINVAL;
   865		}
   866	
   867		priv = devm_kzalloc(&client->dev, sizeof(struct s5k4ecgx), GFP_KERNEL);
   868		if (!priv)
   869			return -ENOMEM;
   870	
   871		mutex_init(&priv->lock);
   872		priv->streaming = 0;
   873	
   874		sd = &priv->sd;
   875		/* Registering subdev */
   876		v4l2_i2c_subdev_init(sd, client, &s5k4ecgx_ops);
   877		/* Static name; NEVER use in new drivers! */
   878		strscpy(sd->name, S5K4ECGX_DRIVER_NAME, sizeof(sd->name));
   879	
   880		sd->internal_ops = &s5k4ecgx_subdev_internal_ops;
   881		/* Support v4l2 sub-device user space API */
   882		sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
   883	
   884		priv->pad.flags = MEDIA_PAD_FL_SOURCE;
   885		sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
   886		ret = media_entity_pads_init(&sd->entity, 1, &priv->pad);
   887		if (ret)
   888			return ret;
   889	
   890		/* Request GPIO lines asserted */
   891		priv->stby = devm_gpiod_get(&client->dev, "standby", GPIOD_OUT_HIGH);
   892		if (IS_ERR(priv->stby)) {
   893			v4l2_err(sd, "failed to request gpio S5K4ECGX_STBY");
   894			ret = PTR_ERR(priv->stby);
   895			goto out_err;
   896		}
 > 897		gpiod_set_consumer_name(priv->stby, "S5K4ECGX_STBY);
   898		priv->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
   899		if (IS_ERR(priv->reset)) {
   900			v4l2_err(sd, "failed to request gpio S5K4ECGX_RST");
   901			ret = PTR_ERR(priv->reset);
   902			goto out_err;
   903		}
   904		gpiod_set_consumer_name(priv->reset, "S5K4ECGX_RST");
   905	
   906		for (i = 0; i < S5K4ECGX_NUM_SUPPLIES; i++)
   907			priv->supplies[i].supply = s5k4ecgx_supply_names[i];
   908	
   909		ret = devm_regulator_bulk_get(&client->dev, S5K4ECGX_NUM_SUPPLIES,
   910					 priv->supplies);
   911		if (ret) {
   912			dev_err(&client->dev, "Failed to get regulators\n");
   913			goto out_err;
   914		}
   915		ret = s5k4ecgx_init_v4l2_ctrls(priv);
   916		if (ret)
   917			goto out_err;
   918	
   919		priv->curr_pixfmt = &s5k4ecgx_formats[0];
   920		priv->curr_frmsize = &s5k4ecgx_prev_sizes[0];
   921	
   922		return 0;
   923	
   924	out_err:
   925		media_entity_cleanup(&priv->sd.entity);
   926	
   927		return ret;
   928	}
   929	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[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