Re: [PATCH v2 08/24] ASoC: codecs: wsa884x: register the die temperature as a thermal zone

From: kernel test robot

Date: Mon Nov 23 2026 - 19:26:13 EST


Hi Srinivas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20261120]
[cannot apply to broonie-sound/for-next tiwai-sound/for-next tiwai-sound/for-linus robh/for-next v7.4-rc3 v7.4-rc2 v7.4-rc1 linus/master v7.4-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Srinivas-Kandagatla/ASoC-soc-pcm-add-multi_direction_codecs-link-flag/20261122-161415
base: next-20261120
patch link: https://lore.kernel.org/r/20261122161437.5994-9-srinivas.kandagatla%40oss.qualcomm.com
patch subject: [PATCH v2 08/24] ASoC: codecs: wsa884x: register the die temperature as a thermal zone
config: i386-buildonly-randconfig-1001-20261124 (https://download.01.org/0day-ci/archive/20261124/20261124081056.uJlgRhV6-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261124/20261124081056.uJlgRhV6-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/20261124081056.uJlgRhV6-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

sound/soc/codecs/wsa884x.c: In function 'wsa884x_probe':
>> sound/soc/codecs/wsa884x.c:2248:60: warning: passing argument 3 of 'thermal_tripless_zone_device_register' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
2248 | &wsa884x_tz_ops,
| ^~~~~~~~~~~~~~~
In file included from sound/soc/codecs/wsa884x.c:26:
include/linux/thermal.h:333:73: note: expected 'struct thermal_zone_device_ops *' but argument is of type 'const struct thermal_zone_device_ops *'
333 | struct thermal_zone_device_ops *ops,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~


vim +2248 sound/soc/codecs/wsa884x.c

2143
2144 static int wsa884x_probe(struct sdw_slave *pdev,
2145 const struct sdw_device_id *id)
2146 {
2147 struct device *dev = &pdev->dev;
2148 struct wsa884x_priv *wsa884x;
2149 unsigned int i;
2150 int ret;
2151
2152 wsa884x = devm_kzalloc_obj(dev, *wsa884x);
2153 if (!wsa884x)
2154 return -ENOMEM;
2155
2156 mutex_init(&wsa884x->sp_lock);
2157
2158 for (i = 0; i < WSA884X_SUPPLIES_NUM; i++)
2159 wsa884x->supplies[i].supply = wsa884x_supply_name[i];
2160
2161 ret = devm_regulator_bulk_get(dev, WSA884X_SUPPLIES_NUM,
2162 wsa884x->supplies);
2163 if (ret)
2164 return dev_err_probe(dev, ret, "Failed to get regulators\n");
2165
2166 ret = regulator_bulk_enable(WSA884X_SUPPLIES_NUM, wsa884x->supplies);
2167 if (ret)
2168 return dev_err_probe(dev, ret, "Failed to enable regulators\n");
2169
2170 ret = devm_add_action_or_reset(dev, wsa884x_regulator_disable,
2171 wsa884x->supplies);
2172 if (ret)
2173 return ret;
2174
2175 ret = wsa884x_get_reset(dev, wsa884x);
2176 if (ret)
2177 return ret;
2178
2179 dev_set_drvdata(dev, wsa884x);
2180 wsa884x->slave = pdev;
2181 wsa884x->dev = dev;
2182 wsa884x->dev_mode = WSA884X_SPEAKER;
2183 wsa884x->sconfig.ch_count = 1;
2184 wsa884x->sconfig.bps = 1;
2185 wsa884x->sconfig.direction = SDW_DATA_DIR_RX;
2186 wsa884x->sconfig.type = SDW_STREAM_PDM;
2187
2188 /*
2189 * Port map index starts with 0, however the data port for this codec
2190 * are from index 1
2191 */
2192 if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping", &pdev->m_port_map[1],
2193 WSA884X_MAX_SWR_PORTS))
2194 dev_dbg(dev, "Static Port mapping not specified\n");
2195
2196 pdev->prop.sink_ports = GENMASK(WSA884X_MAX_SWR_PORTS - 1, 0) & ~BIT(WSA884X_PORT_VISENSE);
2197 pdev->prop.source_ports = BIT(WSA884X_PORT_VISENSE);
2198 pdev->prop.simple_clk_stop_capable = true;
2199 pdev->prop.sink_dpn_prop = wsa884x_sink_dpn_prop;
2200 pdev->prop.src_dpn_prop = wsa884x_src_dpn_prop;
2201 pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
2202
2203 wsa884x_reset_deassert(wsa884x);
2204 ret = devm_add_action_or_reset(dev, wsa884x_reset_powerdown, wsa884x);
2205 if (ret)
2206 return ret;
2207
2208 wsa884x->regmap = devm_regmap_init_sdw(pdev, &wsa884x_regmap_config);
2209 if (IS_ERR(wsa884x->regmap))
2210 return dev_err_probe(dev, PTR_ERR(wsa884x->regmap),
2211 "regmap_init failed\n");
2212
2213 /* Start in cache-only until device is enumerated */
2214 regcache_cache_only(wsa884x->regmap, true);
2215
2216 if (IS_REACHABLE(CONFIG_HWMON)) {
2217 struct device *hwmon;
2218
2219 hwmon = devm_hwmon_device_register_with_info(dev, "wsa884x",
2220 wsa884x,
2221 &wsa884x_hwmon_chip_info,
2222 NULL);
2223 if (IS_ERR(hwmon))
2224 return dev_err_probe(dev, PTR_ERR(hwmon),
2225 "Failed to register hwmon sensor\n");
2226 }
2227
2228 pm_runtime_set_autosuspend_delay(dev, 3000);
2229 pm_runtime_use_autosuspend(dev);
2230 pm_runtime_mark_last_busy(dev);
2231 pm_runtime_set_active(dev);
2232 ret = devm_pm_runtime_enable(dev);
2233 if (ret)
2234 return ret;
2235
2236 if (IS_REACHABLE(CONFIG_THERMAL)) {
2237 char tz_name[THERMAL_NAME_LENGTH];
2238 struct thermal_zone_device *tz;
2239
2240 /*
2241 * Register after runtime PM is enabled, as the zone is read
2242 * right away. dev_name() is too long for a zone name.
2243 */
2244 scnprintf(tz_name, sizeof(tz_name), "wsa-%d-%u",
2245 pdev->bus->id, pdev->id.unique_id);
2246 tz = thermal_tripless_zone_device_register(tz_name,
2247 wsa884x,
> 2248 &wsa884x_tz_ops,
2249 NULL);
2250 if (IS_ERR(tz)) {
2251 dev_warn(dev,
2252 "thermal zone '%s' registration failed (%ld); SP T0 kcontrol will read 0 for this codec\n",
2253 tz_name, PTR_ERR(tz));
2254 } else {
2255 ret = devm_add_action_or_reset(dev,
2256 wsa884x_tz_unregister,
2257 tz);
2258 if (ret)
2259 return ret;
2260
2261 thermal_zone_device_enable(tz);
2262 }
2263 }
2264
2265 return devm_snd_soc_register_component(dev,
2266 &wsa884x_component_drv,
2267 wsa884x_dais,
2268 ARRAY_SIZE(wsa884x_dais));
2269 }
2270

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