drivers/input/touchscreen/cyttsp_i2c.c:47:18: error: implicit declaration of function 'i2c_transfer'
From: kernel test robot
Date: Tue Oct 01 2024 - 20:04:25 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e32cde8d2bd7d251a8f9b434143977ddf13dcec6
commit: 25162a4f64f8ba0065f300977589fe1f6af332f0 Input: cyttsp4 - remove driver
date: 8 weeks ago
config: x86_64-randconfig-001-20231120 (https://download.01.org/0day-ci/archive/20241002/202410020735.aBI61ZYn-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241002/202410020735.aBI61ZYn-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/202410020735.aBI61ZYn-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
In file included from include/linux/sched.h:38,
from include/linux/percpu.h:13,
from arch/x86/include/asm/msr.h:15,
from arch/x86/include/asm/tsc.h:10,
from arch/x86/include/asm/timex.h:6,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/input/touchscreen/cyttsp_core.h:22,
from drivers/input/touchscreen/cyttsp_i2c.c:16:
include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef]
19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:2928:5: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS'
2928 | #if USE_SPLIT_PTE_PTLOCKS
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/mm_types_task.h:19:45: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined, evaluates to 0 [-Wundef]
19 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mm_types_task.h:20:34: note: in expansion of macro 'USE_SPLIT_PTE_PTLOCKS'
20 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/mm.h:3050:5: note: in expansion of macro 'USE_SPLIT_PMD_PTLOCKS'
3050 | #if USE_SPLIT_PMD_PTLOCKS
| ^~~~~~~~~~~~~~~~~~~~~
drivers/input/touchscreen/cyttsp_i2c.c: In function 'cyttsp_i2c_read_block_data':
>> drivers/input/touchscreen/cyttsp_i2c.c:47:18: error: implicit declaration of function 'i2c_transfer' [-Werror=implicit-function-declaration]
47 | retval = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
| ^~~~~~~~~~~~
drivers/input/touchscreen/cyttsp_i2c.c: In function 'cyttsp_i2c_probe':
drivers/input/touchscreen/cyttsp_i2c.c:90:14: error: implicit declaration of function 'i2c_check_functionality' [-Werror=implicit-function-declaration]
90 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/input/touchscreen/cyttsp_i2c.c: At top level:
drivers/input/touchscreen/cyttsp_i2c.c:128:1: warning: data definition has no type or storage class
128 | module_i2c_driver(cyttsp_i2c_driver);
| ^~~~~~~~~~~~~~~~~
drivers/input/touchscreen/cyttsp_i2c.c:128:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]
drivers/input/touchscreen/cyttsp_i2c.c:128:1: warning: parameter names (without types) in function declaration
drivers/input/touchscreen/cyttsp_i2c.c:118:26: warning: 'cyttsp_i2c_driver' defined but not used [-Wunused-variable]
118 | static struct i2c_driver cyttsp_i2c_driver = {
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/i2c_transfer +47 drivers/input/touchscreen/cyttsp_i2c.c
24
25 static int cyttsp_i2c_read_block_data(struct device *dev, u8 *xfer_buf,
26 u16 addr, u8 length, void *values)
27 {
28 struct i2c_client *client = to_i2c_client(dev);
29 u8 client_addr = client->addr | ((addr >> 8) & 0x1);
30 u8 addr_lo = addr & 0xFF;
31 struct i2c_msg msgs[] = {
32 {
33 .addr = client_addr,
34 .flags = 0,
35 .len = 1,
36 .buf = &addr_lo,
37 },
38 {
39 .addr = client_addr,
40 .flags = I2C_M_RD,
41 .len = length,
42 .buf = values,
43 },
44 };
45 int retval;
46
> 47 retval = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
48 if (retval < 0)
49 return retval;
50
51 return retval != ARRAY_SIZE(msgs) ? -EIO : 0;
52 }
53
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki