2pecshy / eeprom-ST25DV-linux-driver

eeprom-ST25DV-linux-driver
GNU General Public License v2.0
11 stars 12 forks source link

does not compile #13

Open wdj2005 opened 6 months ago

wdj2005 commented 6 months ago

Does not compile on Raspian Bullseye, Kernel version 6.1.21-v7+

Error is as follows:

will@homestats:~/eeprom-ST25DV-linux-driver/src $ make all make -C /lib/modules/6.1.21-v7+/build M=/home/will/eeprom-ST25DV-linux-driver/src modules make[1]: Entering directory '/usr/src/linux-headers-6.1.21-v7+' CC [M] /home/will/eeprom-ST25DV-linux-driver/src/st25dv.o /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c: In function ‘st25dv_detect’: /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c:316:6: error: implicit declaration of function ‘i2c_new_dummy’ [-Werror=implicit-function-declaration] 316 | if(!i2c_new_dummy(client->adapter, SYS_ADDR)){ | ^~~~~ /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c: In function ‘st25dv_probe’: /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c:343:18: warning: assignment to ‘struct i2c_client ’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 343 | client_sys_area = i2c_new_dummy(client->adapter, SYS_ADDR); | ^ /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c: At top level: /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c:514:13: error: initialization of ‘void ()(struct i2c_client )’ from incompatible pointer type ‘int ()(struct i2c_client )’ [-Werror=incompatible-pointer-types] 514 | .remove = st25dv_remove, | ^~~~~ /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c:514:13: note: (near initialization for ‘st25dv_driver.remove’) /home/will/eeprom-ST25DV-linux-driver/src/st25dv.c:116:16: warning: ‘st25dv_write_area’ defined but not used [-Wunused-function] 116 | static ssize_t st25dv_write_area(struct file filp, struct kobject *kobj, | ^~~~~ cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:250: /home/will/eeprom-ST25DV-linux-driver/src/st25dv.o] Error 1 make[1]: [Makefile:2012: /home/will/eeprom-ST25DV-linux-driver/src] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.1.21-v7+' make: *** [Makefile:8: all] Error 2

s-hemer commented 6 months ago

Convert to i2c_new_dummy_device, cmp i.e. https://patchwork.kernel.org/project/linux-renesas-soc/patch/20191206002322.12801-1-wsa+renesas@sang-engineering.com/ Only compile tested with 5.15 up to now.

cmz97 commented 4 months ago

Any plan on supporting the up to 6.6.20? After replacing the i2c_new_dummy to i2c_new_dummy_device, there are still error regarding function declaration. Much appreciated!

s-hemer commented 4 months ago

Did you check the fork https://github.com/mozys/eeprom-ST25DV-linux-driver/ ?

cmz97 commented 4 months ago

Appreciate the response, I just tried that fork, still getting the I2C Header Mis-match error. Although, less error. The main error remains still regarding the st25dv_probe function.

/home/kevin/Driver/newEEprom/eeprom-ST25DV-linux-driver/src/st25dv.c:511:27: error: initialization of ‘int (*)(struct i2c_client *)’ from incompatible pointer type ‘int (*)(struct i2c_client *, const struct i2c_device_id *)’ [-Werror=incompatible-pointer-types] 511 | .probe = st25dv_probe, | ^~~~~~~~~~~~ /home/kevin/Driver/newEEprom/eeprom-ST25DV-linux-driver/src/st25dv.c:511:27: note: (near initialization for ‘st25dv_driver.probe’) /home/kevin/Driver/newEEprom/eeprom-ST25DV-linux-driver/src/st25dv.c:116:16: warning: ‘st25dv_write_area’ defined but not used [-Wunused-function] 116 | static ssize_t st25dv_write_area(struct file *filp, struct kobject *kobj, | ^~~~~~~~~~~~~~~~~

I have attempted to fix this issue myself. However, with no expereience writing linux driver, I have a hard time to make the code work if I conform to the new header style, with it ommiting the const struct i2c_device_id * .