Skip to contentSkip to conversation

drivers/hwmon/cros_ec_hwmon.c:535:10: error: implicit declaration of function 'devm_thermal_cooling_device_register'; did you mean 'devm_thermal_of_cooling_device_register'?

PATCH kernel test robot 1 participant 1 message May 30

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hi Daniel,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git thermal/bleeding-edge
head:   100e27ef9a645f07881160256b7131fb40885215
commit: fe809a49f5cd6e2e0b24bf3c1b1af588b1a19760 [23/30] hwmon: Use non-OF thermal cooling device registration API
config: arm64-randconfig-004-20260530 (https://download.01.org/0day-ci/archive/20260530/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260530/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All error/warnings (new ones prefixed by >>):

drivers/hwmon/cros_ec_hwmon.c: In function 'cros_ec_hwmon_register_fan_cooling_devices':

>> drivers/hwmon/cros_ec_hwmon.c:535:10: error: implicit declaration of function 'devm_thermal_cooling_device_register'; did you mean 'devm_thermal_of_cooling_device_register'? [-Werror=implicit-function-declaration]
      cdev = devm_thermal_cooling_device_register(dev, type, cpriv,
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             devm_thermal_of_cooling_device_register
>> drivers/hwmon/cros_ec_hwmon.c:535:8: warning: assignment to 'struct thermal_cooling_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]

cdev = devm_thermal_cooling_device_register(dev, type, cpriv,
^
cc1: some warnings being treated as errors

vim +535 drivers/hwmon/cros_ec_hwmon.c

504
505 static void cros_ec_hwmon_register_fan_cooling_devices(struct device *dev,
506 struct cros_ec_hwmon_priv *priv)
507 {
508 struct cros_ec_hwmon_cooling_priv *cpriv;
509 struct thermal_cooling_device *cdev;
510 const char *type;
511 size_t i;
512
513 if (!IS_ENABLED(CONFIG_THERMAL))
514 return;
515
516 if (!priv->fan_control_supported)
517 return;
518
519 for (i = 0; i < EC_FAN_SPEED_ENTRIES; i++) {
520 if (!(priv->usable_fans & BIT(i)))
521 continue;
522
523 cpriv = devm_kzalloc(dev, sizeof(*cpriv), GFP_KERNEL);
524 if (!cpriv)
525 continue;
526
527 type = devm_kasprintf(dev, GFP_KERNEL, "%s-fan%zu", dev_name(dev), i);
528 if (!type) {
529 dev_warn(dev, "no memory to compose cooling device type for fan %zu\n", i);
530 continue;
531 }
532
533 cpriv->hwmon_priv = priv;
534 cpriv->index = i;

 > 535			cdev = devm_thermal_cooling_device_register(dev, type, cpriv,

536 &cros_ec_thermal_cooling_ops);
537 if (IS_ERR(cdev)) {
538 dev_warn(dev, "failed to register fan %zu as a cooling device: %pe\n", i,
539 cdev);
540 continue;
541 }
542 }
543 }
544

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