drivers/iio/common/scmi_sensors/scmi_iio.c:309:29: error: 'struct scmi_iio_priv' has no member named 'handle'

From: kernel test robot
Date: Mon Sep 27 2021 - 19:43:39 EST


tree: https://github.com/0day-ci/linux/commits/Andriy-Tryshnivskyy/iio-scmi-Add-reading-raw-attribute/20210922-162517
head: d991091086871ace610efcdfdaeab371c77aaf42
commit: d991091086871ace610efcdfdaeab371c77aaf42 iio/scmi: Add reading "raw" attribute.
date: 6 days ago
config: parisc-buildonly-randconfig-r005-20210927 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/d991091086871ace610efcdfdaeab371c77aaf42
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andriy-Tryshnivskyy/iio-scmi-Add-reading-raw-attribute/20210922-162517
git checkout d991091086871ace610efcdfdaeab371c77aaf42
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

drivers/iio/common/scmi_sensors/scmi_iio.c: In function 'scmi_iio_read_raw':
>> drivers/iio/common/scmi_sensors/scmi_iio.c:309:29: error: 'struct scmi_iio_priv' has no member named 'handle'
309 | err = sensor->handle->sensor_ops->config_set(
| ^~
drivers/iio/common/scmi_sensors/scmi_iio.c:310:31: error: 'struct scmi_iio_priv' has no member named 'handle'
310 | sensor->handle, sensor->sensor_info->id, sensor_config);
| ^~
drivers/iio/common/scmi_sensors/scmi_iio.c:316:29: error: 'struct scmi_iio_priv' has no member named 'handle'
316 | err = sensor->handle->sensor_ops->reading_get_timestamped(
| ^~
drivers/iio/common/scmi_sensors/scmi_iio.c:317:31: error: 'struct scmi_iio_priv' has no member named 'handle'
317 | sensor->handle, sensor->sensor_info->id,
| ^~
drivers/iio/common/scmi_sensors/scmi_iio.c:329:29: error: 'struct scmi_iio_priv' has no member named 'handle'
329 | err = sensor->handle->sensor_ops->config_set(
| ^~
drivers/iio/common/scmi_sensors/scmi_iio.c:330:31: error: 'struct scmi_iio_priv' has no member named 'handle'
330 | sensor->handle, sensor->sensor_info->id, sensor_config);
| ^~


vim +309 drivers/iio/common/scmi_sensors/scmi_iio.c

281
282 static int scmi_iio_read_raw(struct iio_dev *iio_dev,
283 struct iio_chan_spec const *ch, int *val,
284 int *val2, long mask)
285 {
286 struct scmi_iio_priv *sensor = iio_priv(iio_dev);
287 s8 scale;
288 int ret;
289 int err;
290 u32 sensor_config;
291 struct scmi_sensor_reading readings[SCMI_IIO_NUM_OF_AXIS];
292
293 switch (mask) {
294 case IIO_CHAN_INFO_SCALE:
295 scale = sensor->sensor_info->axis[ch->scan_index].scale;
296 if (scale < 0) {
297 *val = 1;
298 *val2 = int_pow(10, abs(scale));
299 return IIO_VAL_FRACTIONAL;
300 }
301 *val = int_pow(10, scale);
302 return IIO_VAL_INT;
303 case IIO_CHAN_INFO_SAMP_FREQ:
304 ret = scmi_iio_get_odr_val(iio_dev, val, val2);
305 return ret ? ret : IIO_VAL_INT_PLUS_MICRO;
306 case IIO_CHAN_INFO_RAW:
307 sensor_config = FIELD_PREP(SCMI_SENS_CFG_SENSOR_ENABLED_MASK,
308 SCMI_SENS_CFG_SENSOR_ENABLE);
> 309 err = sensor->handle->sensor_ops->config_set(
310 sensor->handle, sensor->sensor_info->id, sensor_config);
311 if (err)
312 dev_err(&iio_dev->dev,
313 "Error in enabling sensor %s err %d",
314 sensor->sensor_info->name, err);
315
316 err = sensor->handle->sensor_ops->reading_get_timestamped(
317 sensor->handle, sensor->sensor_info->id,
318 sensor->sensor_info->num_axis,
319 (struct scmi_sensor_reading *)&readings);
320 if (err) {
321 dev_err(&iio_dev->dev,
322 "Error in reading raw attribute for sensor %s err %d",
323 sensor->sensor_info->name, err);
324 return err;
325 }
326
327 sensor_config = FIELD_PREP(SCMI_SENS_CFG_SENSOR_ENABLED_MASK,
328 SCMI_SENS_CFG_SENSOR_DISABLE);
329 err = sensor->handle->sensor_ops->config_set(
330 sensor->handle, sensor->sensor_info->id, sensor_config);
331 if (err)
332 dev_err(&iio_dev->dev,
333 "Error in enabling sensor %s err %d",
334 sensor->sensor_info->name, err);
335 /* Use 32-bit value, since practically there is no need in 64 bits */
336 *val = (u32)readings[ch->scan_index].value;
337 return IIO_VAL_INT;
338 default:
339 return -EINVAL;
340 }
341 }
342

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip