Re: [PATCH v2] staging: iio: adc: ad7816: Protect sysfs attributes with mutex
From: kernel test robot
Date: Wed Sep 23 2026 - 08:50:21 EST
Hi Abdelnasser,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Abdelnasser-Hussein/staging-iio-adc-ad7816-Protect-sysfs-attributes-with-mutex/20260920-121522
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20260920091522.15507-1-abdelnasserhussein11%40gmail.com
patch subject: [PATCH v2] staging: iio: adc: ad7816: Protect sysfs attributes with mutex
config: i386-randconfig-2102-20260923 (https://download.01.org/0day-ci/archive/20260923/202609231453.RPvUxbGl-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260923/202609231453.RPvUxbGl-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/202609231453.RPvUxbGl-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
>> drivers/staging/iio/adc/ad7816.c:139:22: error: no member named 'lock' in 'struct ad7816_chip_info'
139 | guard(mutex)(&chip->lock);
| ~~~~ ^
include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
423 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
303 | class_##_name##_constructor
| ^
<scratch space>:67:1: note: expanded from here
67 | class_mutex_constructor
| ^
>> drivers/staging/iio/adc/ad7816.c:139:22: error: no member named 'lock' in 'struct ad7816_chip_info'
139 | guard(mutex)(&chip->lock);
| ~~~~ ^
include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
423 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
303 | class_##_name##_constructor
| ^
<scratch space>:67:1: note: expanded from here
67 | class_mutex_constructor
| ^
drivers/staging/iio/adc/ad7816.c:205:22: error: no member named 'lock' in 'struct ad7816_chip_info'
205 | guard(mutex)(&chip->lock);
| ~~~~ ^
include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
423 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
303 | class_##_name##_constructor
| ^
<scratch space>:107:1: note: expanded from here
107 | class_mutex_constructor
| ^
drivers/staging/iio/adc/ad7816.c:205:22: error: no member named 'lock' in 'struct ad7816_chip_info'
205 | guard(mutex)(&chip->lock);
| ~~~~ ^
include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
423 | CLASS(_name, __UNIQUE_ID(guard))
| ^
include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
303 | class_##_name##_constructor
| ^
<scratch space>:107:1: note: expanded from here
107 | class_mutex_constructor
| ^
4 errors generated.
vim +139 drivers/staging/iio/adc/ad7816.c
130
131 static ssize_t ad7816_store_mode(struct device *dev,
132 struct device_attribute *attr,
133 const char *buf,
134 size_t len)
135 {
136 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
137 struct ad7816_chip_info *chip = iio_priv(indio_dev);
138
> 139 guard(mutex)(&chip->lock);
140
141 if (strcmp(buf, "full") == 0) {
142 gpiod_set_value(chip->rdwr_pin, 1);
143 chip->mode = AD7816_FULL;
144 } else {
145 gpiod_set_value(chip->rdwr_pin, 0);
146 chip->mode = AD7816_PD;
147 }
148
149 return len;
150 }
151
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki