All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: wifi: mt76: mt7996: add thermal zone device registration
Date: Sun, 4 Oct 2026 07:05:06 +0800	[thread overview]
Message-ID: <202610040604.2y7T17Mw-lkp@intel.com> (raw)
In-Reply-To: <202610040604.2y7T17Mw-lkp@intel.com>

Hi Ryan,

kernel test robot noticed the following build errors:



url:    https://github.com/intel-lab-lkp/linux/commits/Ryan-Leung-via-B4-Relay/wifi-mt76-mt7996-add-thermal-zone-device-registration/20261003-041935
base:   
patch link:    https://lore.kernel.org/r/202610040604.2y7T17Mw-lkp%40intel.com
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20261004/202610040604.2y7T17Mw-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261004/202610040604.2y7T17Mw-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610040604.2y7T17Mw-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/wireless/mediatek/mt76/mt7996/init.c:262:3: error: call to undeclared function 'thermal_of_zone_unregister'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     262 |                 thermal_of_zone_unregister(phy->tzone);
         |                 ^
   drivers/net/wireless/mediatek/mt76/mt7996/init.c:262:3: note: did you mean 'devm_thermal_of_zone_unregister'?
   include/linux/thermal.h:202:6: note: 'devm_thermal_of_zone_unregister' declared here
     202 | void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zone_device *tz);
         |      ^
>> drivers/net/wireless/mediatek/mt76/mt7996/init.c:303:15: error: call to undeclared function 'thermal_of_zone_register'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     303 |         phy->tzone = thermal_of_zone_register(phy->dev->mt76.dev,
         |                      ^
   drivers/net/wireless/mediatek/mt76/mt7996/init.c:303:15: note: did you mean 'devm_thermal_of_zone_register'?
   include/linux/thermal.h:199:29: note: 'devm_thermal_of_zone_register' declared here
     199 | struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data,
         |                             ^
>> drivers/net/wireless/mediatek/mt76/mt7996/init.c:303:13: error: incompatible integer to pointer conversion assigning to 'struct thermal_zone_device *' from 'int' [-Wint-conversion]
     303 |         phy->tzone = thermal_of_zone_register(phy->dev->mt76.dev,
         |                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     304 |                                               phy->mt76->band_idx, phy,
         |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~
     305 |                                               &mt7996_tz_ops);
         |                                               ~~~~~~~~~~~~~~~
   3 errors generated.


vim +/thermal_of_zone_unregister +262 drivers/net/wireless/mediatek/mt76/mt7996/init.c

   255	
   256	static void mt7996_unregister_thermal(struct mt7996_phy *phy)
   257	{
   258		struct wiphy *wiphy = phy->mt76->hw->wiphy;
   259		char name[sizeof("cooling_deviceXXX")];
   260	
   261		if (phy->tzone) {
 > 262			thermal_of_zone_unregister(phy->tzone);
   263			phy->tzone = NULL;
   264		}
   265	
   266		if (!phy->cdev)
   267			return;
   268	
   269		snprintf(name, sizeof(name), "cooling_device%d", phy->mt76->band_idx);
   270		sysfs_remove_link(&wiphy->dev.kobj, name);
   271		thermal_cooling_device_unregister(phy->cdev);
   272		phy->cdev = NULL;
   273	}
   274	
   275	static int mt7996_thermal_init(struct mt7996_phy *phy)
   276	{
   277		struct wiphy *wiphy = phy->mt76->hw->wiphy;
   278		char cname[sizeof("cooling_deviceXXX")];
   279		struct thermal_cooling_device *cdev;
   280		struct device *hwmon;
   281		const char *name;
   282	
   283		name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7996_%s.%d",
   284				      wiphy_name(wiphy), phy->mt76->band_idx);
   285		if (!name)
   286			return -ENOMEM;
   287	
   288		snprintf(cname, sizeof(cname), "cooling_device%d", phy->mt76->band_idx);
   289	
   290		cdev = thermal_cooling_device_register(name, phy, &mt7996_thermal_ops);
   291		if (!IS_ERR(cdev)) {
   292			if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj,
   293					      cname) < 0)
   294				thermal_cooling_device_unregister(cdev);
   295			else
   296				phy->cdev = cdev;
   297		}
   298	
   299		/* initialize critical/maximum high temperature */
   300		phy->throttle_temp[MT7996_CRIT_TEMP_IDX] = MT7996_CRIT_TEMP;
   301		phy->throttle_temp[MT7996_MAX_TEMP_IDX] = MT7996_MAX_TEMP;
   302	
 > 303		phy->tzone = thermal_of_zone_register(phy->dev->mt76.dev,
   304						      phy->mt76->band_idx, phy,
   305						      &mt7996_tz_ops);
   306		if (IS_ERR(phy->tzone)) {
   307			if (PTR_ERR(phy->tzone) != -ENODEV)
   308				dev_warn(phy->dev->mt76.dev,
   309					 "failed to register thermal zone %d: %ld\n",
   310					 phy->mt76->band_idx, PTR_ERR(phy->tzone));
   311			phy->tzone = NULL;
   312		}
   313	
   314		if (!IS_REACHABLE(CONFIG_HWMON))
   315			return 0;
   316	
   317		hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy,
   318							       mt7996_hwmon_groups);
   319	
   320		if (IS_ERR(hwmon)) {
   321			mt7996_unregister_thermal(phy);
   322			return PTR_ERR(hwmon);
   323		}
   324	
   325		return 0;
   326	}
   327	

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

       reply	other threads:[~2026-10-03 23:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03 23:05 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-10-03 21:07 wifi: mt76: mt7996: add thermal zone device registration kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202610040604.2y7T17Mw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.