Re: [PATCH v4 2/5] platform: arm64: Add driver for EC found on Qualcomm reference devices
From: kernel test robot
Date: Mon Mar 16 2026 - 13:37:06 EST
Hi Anvesh,
kernel test robot noticed the following build warnings:
[auto build test WARNING on a0ae2a256046c0c5d3778d1a194ff2e171f16e5f]
url: https://github.com/intel-lab-lkp/linux/commits/Anvesh-Jain-P/dt-bindings-embedded-controller-Add-EC-bindings-for-Qualcomm-reference-devices/20260314-163112
base: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
patch link: https://lore.kernel.org/r/20260313-v04-add-driver-for-ec-v4-2-ca9d0efd62aa%40oss.qualcomm.com
patch subject: [PATCH v4 2/5] platform: arm64: Add driver for EC found on Qualcomm reference devices
config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20260317/202603170132.IivRdk9p-lkp@xxxxxxxxx/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project f46a5153850c1303d687233d4adf699b01041da8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260317/202603170132.IivRdk9p-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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603170132.IivRdk9p-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
>> drivers/platform/arm64/qcom-hamoa-ec.c:395:31: warning: variable 'cdev' is uninitialized when used here [-Wuninitialized]
395 | dev_err_probe(dev, PTR_ERR(cdev),
| ^~~~
drivers/platform/arm64/qcom-hamoa-ec.c:350:34: note: initialize the variable 'cdev' to silence this warning
350 | struct qcom_ec_cooling_dev *cdev;
| ^
| = NULL
1 warning generated.
vim +/cdev +395 drivers/platform/arm64/qcom-hamoa-ec.c
347
348 static int qcom_ec_probe(struct i2c_client *client)
349 {
350 struct qcom_ec_cooling_dev *cdev;
351 struct device *dev = &client->dev;
352 struct qcom_ec *ec;
353 int ret, i;
354
355 ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL);
356 if (!ec)
357 return -ENOMEM;
358
359 ec->client = client;
360
361 ret = devm_request_threaded_irq(dev, client->irq, NULL, qcom_ec_irq,
362 IRQF_ONESHOT, "qcom_ec", ec);
363 if (ret < 0)
364 return dev_err_probe(dev, ret, "Failed to get irq\n");
365
366 i2c_set_clientdata(client, ec);
367
368 ret = qcom_ec_read_fw_version(dev);
369 if (ret < 0)
370 return dev_err_probe(dev, ret, "Failed to read ec firmware version\n");
371
372 ret = qcom_ec_thermal_capabilities(dev);
373 if (ret < 0)
374 return dev_err_probe(dev, ret, "Failed to read thermal capabilities\n");
375
376 ret = qcom_ec_sci_evt_control(dev, true);
377 if (ret < 0)
378 return dev_err_probe(dev, ret, "Failed to enable SCI events\n");
379
380 ec->ec_cdev = devm_kcalloc(dev, ec->thermal_cap.fan_cnt, sizeof(*ec->ec_cdev), GFP_KERNEL);
381 if (!ec->ec_cdev)
382 return -ENOMEM;
383
384 for (i = 0; i < ec->thermal_cap.fan_cnt; i++) {
385 struct qcom_ec_cooling_dev *ec_cdev = &ec->ec_cdev[i];
386 char name[EC_FAN_NAME_SIZE];
387
388 snprintf(name, EC_FAN_NAME_SIZE, "qcom_ec_fan_%d", i);
389 ec_cdev->fan_id = i + 1;
390 ec_cdev->parent_dev = dev;
391
392 ec_cdev->cdev = thermal_cooling_device_register(name, ec_cdev,
393 &qcom_ec_thermal_ops);
394 if (IS_ERR(ec_cdev->cdev)) {
> 395 dev_err_probe(dev, PTR_ERR(cdev),
396 "Thermal cooling device registration failed\n");
397 ret = -EINVAL;
398 goto unroll_cooling_dev;
399 }
400 }
401
402 return 0;
403
404 unroll_cooling_dev:
405 for (i--; i >= 0; i--) {
406 struct qcom_ec_cooling_dev *ec_cdev = &ec->ec_cdev[i];
407
408 if (ec_cdev->cdev) {
409 thermal_cooling_device_unregister(ec_cdev->cdev);
410 ec_cdev->cdev = NULL;
411 }
412 }
413
414 return ret;
415 }
416
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki