sound/soc/codecs/wsa883x.c:1194:25: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'?
From: kernel test robot
Date: Thu Sep 15 2022 - 14:27:59 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3245cb65fd91cd514801bf91f5a3066d562f0ac4
commit: 43b8c7dc85a14f36048a27bb6c627fd49144a8d1 ASoC: codecs: add wsa883x amplifier support
date: 3 months ago
config: sh-randconfig-r001-20220915 (https://download.01.org/0day-ci/archive/20220916/202209160255.25Eu5IJF-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43b8c7dc85a14f36048a27bb6c627fd49144a8d1
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 43b8c7dc85a14f36048a27bb6c627fd49144a8d1
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash sound/soc/codecs/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
sound/soc/codecs/wsa883x.c: In function 'wsa883x_probe':
>> sound/soc/codecs/wsa883x.c:1194:25: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? [-Werror=implicit-function-declaration]
1194 | wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
| ^~~~~~~~~~~~~~~~~~~~~~~
| devm_regulator_get_optional
>> sound/soc/codecs/wsa883x.c:1195:49: error: 'GPIOD_FLAGS_BIT_NONEXCLUSIVE' undeclared (first use in this function)
1195 | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/wsa883x.c:1195:49: note: each undeclared identifier is reported only once for each function it appears in
>> sound/soc/codecs/wsa883x.c:1213:9: error: implicit declaration of function 'gpiod_direction_output'; did you mean 'gpio_direction_output'? [-Werror=implicit-function-declaration]
1213 | gpiod_direction_output(wsa883x->sd_n, 1);
| ^~~~~~~~~~~~~~~~~~~~~~
| gpio_direction_output
cc1: some warnings being treated as errors
vim +1194 sound/soc/codecs/wsa883x.c
1170
1171 static int wsa883x_probe(struct sdw_slave *pdev,
1172 const struct sdw_device_id *id)
1173 {
1174 struct wsa883x_priv *wsa883x;
1175 struct device *dev = &pdev->dev;
1176 int ret;
1177
1178 wsa883x = devm_kzalloc(&pdev->dev, sizeof(*wsa883x), GFP_KERNEL);
1179 if (!wsa883x)
1180 return -ENOMEM;
1181
1182 wsa883x->vdd = devm_regulator_get(dev, "vdd");
1183 if (IS_ERR(wsa883x->vdd)) {
1184 dev_err(dev, "No vdd regulator found\n");
1185 return PTR_ERR(wsa883x->vdd);
1186 }
1187
1188 ret = regulator_enable(wsa883x->vdd);
1189 if (ret) {
1190 dev_err(dev, "Failed to enable vdd regulator (%d)\n", ret);
1191 return ret;
1192 }
1193
> 1194 wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
> 1195 GPIOD_FLAGS_BIT_NONEXCLUSIVE);
1196 if (IS_ERR(wsa883x->sd_n)) {
1197 dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
1198 ret = PTR_ERR(wsa883x->sd_n);
1199 goto err;
1200 }
1201
1202 dev_set_drvdata(&pdev->dev, wsa883x);
1203 wsa883x->slave = pdev;
1204 wsa883x->dev = &pdev->dev;
1205 wsa883x->sconfig.ch_count = 1;
1206 wsa883x->sconfig.bps = 1;
1207 wsa883x->sconfig.direction = SDW_DATA_DIR_RX;
1208 wsa883x->sconfig.type = SDW_STREAM_PDM;
1209
1210 pdev->prop.sink_ports = GENMASK(WSA883X_MAX_SWR_PORTS, 0);
1211 pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
1212 pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
> 1213 gpiod_direction_output(wsa883x->sd_n, 1);
1214
1215 wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config);
1216 if (IS_ERR(wsa883x->regmap)) {
1217 dev_err(&pdev->dev, "regmap_init failed\n");
1218 ret = PTR_ERR(wsa883x->regmap);
1219 goto err;
1220 }
1221 pm_runtime_set_autosuspend_delay(dev, 3000);
1222 pm_runtime_use_autosuspend(dev);
1223 pm_runtime_mark_last_busy(dev);
1224 pm_runtime_set_active(dev);
1225 pm_runtime_enable(dev);
1226
1227 ret = devm_snd_soc_register_component(&pdev->dev,
1228 &wsa883x_component_drv,
1229 wsa883x_dais,
1230 ARRAY_SIZE(wsa883x_dais));
1231 err:
1232 if (ret)
1233 regulator_disable(wsa883x->vdd);
1234
1235 return ret;
1236
--
0-DAY CI Kernel Test Service
https://01.org/lkp