Re: [PATCH v2 6/7] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper
From: Dan Carpenter
Date: Wed Feb 12 2025 - 02:27:03 EST
Hi Jerome,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Jerome-Brunet/driver-core-auxiliary-bus-add-device-creation-helper/20250207-023433
base: 2014c95afecee3e76ca4a56956a936e23283f05b
patch link: https://lore.kernel.org/r/20250206-aux-device-create-helper-v2-6-fa6a0f326527%40baylibre.com
patch subject: [PATCH v2 6/7] clk: clk-imx8mp-audiomix: use the auxiliary device creation helper
config: xtensa-randconfig-r071-20250208 (https://download.01.org/0day-ci/archive/20250208/202502081655.FlCrxpYN-lkp@xxxxxxxxx/config)
compiler: xtensa-linux-gcc (GCC) 14.2.0
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 <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202502081655.FlCrxpYN-lkp@xxxxxxxxx/
smatch warnings:
drivers/clk/imx/clk-imx8mp-audiomix.c:241 clk_imx8mp_audiomix_reset_controller_register() warn: passing zero to 'PTR_ERR'
vim +/PTR_ERR +241 drivers/clk/imx/clk-imx8mp-audiomix.c
c350f4c434316c Jerome Brunet 2025-02-06 231 static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev)
6f0e817175c5b2 Shengjiu Wang 2024-06-14 232 {
c350f4c434316c Jerome Brunet 2025-02-06 233 struct auxiliary_device *adev;
6f0e817175c5b2 Shengjiu Wang 2024-06-14 234
6f0e817175c5b2 Shengjiu Wang 2024-06-14 235 if (!of_property_present(dev->of_node, "#reset-cells"))
6f0e817175c5b2 Shengjiu Wang 2024-06-14 236 return 0;
6f0e817175c5b2 Shengjiu Wang 2024-06-14 237
c350f4c434316c Jerome Brunet 2025-02-06 238 adev = devm_auxiliary_device_create(dev, KBUILD_MODNAME,
c350f4c434316c Jerome Brunet 2025-02-06 239 "reset", NULL, 0);
c350f4c434316c Jerome Brunet 2025-02-06 240 if (IS_ERR_OR_NULL(adev))
c350f4c434316c Jerome Brunet 2025-02-06 @241 return PTR_ERR(adev);
If devm_auxiliary_device_create() could return NULL then that would count
as success. But devm_auxiliary_device_create() can't return NULL. It
only makes sense to return NULL if the auxiliary device is optional.
https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/
6f0e817175c5b2 Shengjiu Wang 2024-06-14 242
6f0e817175c5b2 Shengjiu Wang 2024-06-14 243 return 0;
6f0e817175c5b2 Shengjiu Wang 2024-06-14 244 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki