alex-konshin / gpio-ts

Linux driver for streaming GPIO timestamps
4 stars 3 forks source link

Error while building on Raspberry Pi OS (Bookworm) #1

Open S0lmyr opened 3 months ago

S0lmyr commented 3 months ago

Hello, I am successfully running gpio-ts with f007th-rpi on previous version of Raspberry OS (11 Bullseye) Hovever I want to upgrade it to Bookworm.

So I made fresh installation of Bookworm.

Now, I'm running 64bit version of Rasbian OS (Bookworm)

I've installed kernel headers sudo apt install linux-headers-rpi-v8 my version is now: 6.6.28+rpt-rpi-v8

However, when I tried to run make all on gpio-ts I have some issues:

make -C /lib/modules/6.6.28+rpt-rpi-v8/build M=/home/pi/gpio-ts modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.28+rpt-rpi-v8'
  CC [M]  /home/pi/gpio-ts/gpio-ts.o
In file included from /usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/linkage.h:7,
                 from /usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/kernel.h:17,
                 from /home/pi/gpio-ts/gpio-ts.c:17:
/home/pi/gpio-ts/gpio-ts.c: In function ‘gpio_ts_init’:
/usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/export.h:29:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   29 | #define THIS_MODULE (&__this_module)
      |                     ~^~~~~~~~~~~~~~~
      |                      |
      |                      struct module *
/home/pi/gpio-ts/gpio-ts.c:170:34: note: in expansion of macro ‘THIS_MODULE’
  170 |     gpio_ts_class = class_create(THIS_MODULE, GPIO_TS_CLASS_NAME);
      |                                  ^~~~~~~~~~~
In file included from /usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/device.h:31,
                 from /usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/cdev.h:8,
                 from /home/pi/gpio-ts/gpio-ts.c:18:
/usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/device/class.h:230:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
  230 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~
/home/pi/gpio-ts/gpio-ts.c:170:21: error: too many arguments to function ‘class_create’
  170 |     gpio_ts_class = class_create(THIS_MODULE, GPIO_TS_CLASS_NAME);
      |                     ^~~~~~~~~~~~
/usr/src/linux-headers-6.6.28+rpt-common-rpi/include/linux/device/class.h:230:29: note: declared here
  230 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
/home/pi/gpio-ts/gpio-ts.c:175:28: error: assignment to ‘char * (*)(const struct device *, umode_t *)’ {aka ‘char * (*)(const struct device *, short unsigned int *)’} from incompatible pointer type ‘char * (*)(struct device *, umode_t *)’ {aka ‘char * (*)(struct device *, short unsigned int *)’} [-Werror=incompatible-pointer-types]
  175 |     gpio_ts_class->devnode = gpio_ts_devnode;
      |                            ^
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-6.6.28+rpt-common-rpi/scripts/Makefile.build:248: /home/pi/gpio-ts/gpio-ts.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.6.28+rpt-common-rpi/Makefile:1938: /home/pi/gpio-ts] Error 2
make[1]: *** [/usr/src/linux-headers-6.6.28+rpt-common-rpi/Makefile:246: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.6.28+rpt-rpi-v8'
make: *** [Makefile:11: all] Error 2

Can someone help me please?

phueper commented 3 months ago

Same error for me

phueper commented 3 months ago

i seem to have fixed this for me in #2 ... but i also had to adapt the MAX_GPIO in f007th-rpi, if you also use that, you might also need to do that ... for me now my temp sensors are working again, and i'm happy :)

S0lmyr commented 3 months ago

Hello Patrick,

thank you for sharing your fix. It is working for me either. I was a little bit confused where to edit MAX_GPIO, but made it. Thank you again!