Re: [PATCH v9 3/3] media: i2c: Introduce a driver for the Techwell TW9900 decoder

From: Dan Carpenter
Date: Wed Nov 22 2023 - 05:43:49 EST


Hi Mehdi,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Mehdi-Djait/dt-bindings-vendor-prefixes-Add-techwell-vendor-prefix/20231117-234411
base: git://linuxtv.org/media_tree.git master
patch link: https://lore.kernel.org/r/dc65a89e7803782a75bf663158e031356ef7cb1a.1700235276.git.mehdi.djait%40bootlin.com
patch subject: [PATCH v9 3/3] media: i2c: Introduce a driver for the Techwell TW9900 decoder
config: powerpc-randconfig-r071-20231122 (https://download.01.org/0day-ci/archive/20231122/202311221134.0i9KavRs-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231122/202311221134.0i9KavRs-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>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>
| Closes: https://lore.kernel.org/r/202311221134.0i9KavRs-lkp@xxxxxxxxx/

New smatch warnings:
drivers/media/i2c/tw9900.c:628 tw9900_runtime_resume() warn: inconsistent returns '&tw9900->mutex'.

Old smatch warnings:
drivers/media/i2c/tw9900.c:348 tw9900_s_std() error: uninitialized symbol 'mode'.

vim +628 drivers/media/i2c/tw9900.c

cf24af11e0a74c Mehdi Djait 2023-11-17 597 static int tw9900_runtime_resume(struct device *dev)
cf24af11e0a74c Mehdi Djait 2023-11-17 598 {
cf24af11e0a74c Mehdi Djait 2023-11-17 599 struct i2c_client *client = to_i2c_client(dev);
cf24af11e0a74c Mehdi Djait 2023-11-17 600 struct v4l2_subdev *sd = i2c_get_clientdata(client);
cf24af11e0a74c Mehdi Djait 2023-11-17 601 struct tw9900 *tw9900 = to_tw9900(sd);
cf24af11e0a74c Mehdi Djait 2023-11-17 602 int ret;
cf24af11e0a74c Mehdi Djait 2023-11-17 603
cf24af11e0a74c Mehdi Djait 2023-11-17 604 mutex_lock(&tw9900->mutex);
cf24af11e0a74c Mehdi Djait 2023-11-17 605
cf24af11e0a74c Mehdi Djait 2023-11-17 606 if (tw9900->reset_gpio)
cf24af11e0a74c Mehdi Djait 2023-11-17 607 gpiod_set_value_cansleep(tw9900->reset_gpio, 1);
cf24af11e0a74c Mehdi Djait 2023-11-17 608
cf24af11e0a74c Mehdi Djait 2023-11-17 609 ret = regulator_enable(tw9900->regulator);
cf24af11e0a74c Mehdi Djait 2023-11-17 610 if (ret < 0)
cf24af11e0a74c Mehdi Djait 2023-11-17 611 return ret;

mutex_unlock(&tw9900->mutex) before returning.

cf24af11e0a74c Mehdi Djait 2023-11-17 612
cf24af11e0a74c Mehdi Djait 2023-11-17 613 usleep_range(50000, 52000);
cf24af11e0a74c Mehdi Djait 2023-11-17 614
cf24af11e0a74c Mehdi Djait 2023-11-17 615 if (tw9900->reset_gpio)
cf24af11e0a74c Mehdi Djait 2023-11-17 616 gpiod_set_value_cansleep(tw9900->reset_gpio, 0);
cf24af11e0a74c Mehdi Djait 2023-11-17 617
cf24af11e0a74c Mehdi Djait 2023-11-17 618 usleep_range(1000, 2000);
cf24af11e0a74c Mehdi Djait 2023-11-17 619
cf24af11e0a74c Mehdi Djait 2023-11-17 620 ret = tw9900_write_array(tw9900->client, tw9900_init_regs,
cf24af11e0a74c Mehdi Djait 2023-11-17 621 ARRAY_SIZE(tw9900_init_regs));
cf24af11e0a74c Mehdi Djait 2023-11-17 622
cf24af11e0a74c Mehdi Djait 2023-11-17 623 mutex_unlock(&tw9900->mutex);
cf24af11e0a74c Mehdi Djait 2023-11-17 624
cf24af11e0a74c Mehdi Djait 2023-11-17 625 /* This sleep is needed for the Horizontal Sync PLL to lock. */
cf24af11e0a74c Mehdi Djait 2023-11-17 626 msleep(300);
cf24af11e0a74c Mehdi Djait 2023-11-17 627
cf24af11e0a74c Mehdi Djait 2023-11-17 @628 return ret;
cf24af11e0a74c Mehdi Djait 2023-11-17 629 }

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