Dahdi on alma 9.4

Hello!

Just upgraded system to alma9.4 ( clone of rhel 9.4) and dahdi compilation fails:
DAHDI_BUILD_ALL=m
make[1]: Entering directory ‘/usr/src/kernels/5.14.0-427.13.1.el9_4.x86_64’
CC [M] /usr/src/dahdi/drivers/dahdi/dahdi-sysfs.o
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs.c:272:27: error: initialization of ‘int (*)(const struct device *, struct kobj_uevent_env )’ from incompatible pointer type 'int ()(struct device *, struct kobj_uevent_env )’ [-Werror=incompatible-pointer-types]
272 | .uevent = span_uevent,
| ^~~~~~~~~~~
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs.c:272:27: note: (near initialization for ‘spans_bus_type.uevent’)
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs.c:709:27: error: initialization of 'int (
)(const struct device *, struct kobj_uevent_env )’ from incompatible pointer type 'int ()(struct device *, struct kobj_uevent_env *)’ [-Werror=incompatible-pointer-types]
709 | .uevent = device_uevent,
| ^~~~~~~~~~~~~
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs.c:709:27: note: (near initialization for ‘dahdi_device_bus.uevent’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:299: /usr/src/dahdi/drivers/dahdi/dahdi-sysfs.o] Error 1
make[1]: *** [Makefile:1934: /usr/src/dahdi/drivers/dahdi] Error 2
make[1]: Leaving directory ‘/usr/src/kernels/5.14.0-427.13.1.el9_4.x86_64’
make: *** [Makefile:74: modules] Error 2

Do you have an idea how to fix this?

Thank you!

OK, I changed parameter to const

static int device_uevent(const struct device *dev, struct kobj_uevent_env *kenv)

now I have another problem:

In file included from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from /usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.c:26:
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.c: In function ‘dahdi_sysfs_chan_init’:
./include/linux/export.h:17:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
17 | #define THIS_MODULE (&__this_module)
| ~^~~~~~~~~~~~~~~
| |
| struct module *
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.c:485:36: note: in expansion of macro ‘THIS_MODULE’
485 | dahdi_class = class_create(THIS_MODULE, “dahdi”);
| ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
from /usr/src/dahdi/include/dahdi/kernel.h:42,
from /usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.c:30:
./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);
| ^~
/usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.c:485:23: error: too many arguments to function ‘class_create’
485 | dahdi_class = class_create(THIS_MODULE, “dahdi”);
| ^
~
In file included from ./include/linux/device.h:31,
from /usr/src/dahdi/include/dahdi/kernel.h:42,
from /usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.c:30:
./include/linux/device/class.h:230:29: note: declared here
230 | struct class * __must_check class_create(const char *name);
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:299: /usr/src/dahdi/drivers/dahdi/dahdi-sysfs-chan.o] Error 1
make[1]: *** [Makefile:1934: /usr/src/dahdi/drivers/dahdi] Error 2
make[1]: Leaving directory ‘/usr/src/kernels/5.14.0-427.13.1.el9_4.x86_64’
make: *** [Makefile:74: modules] Error 2

looks like this is OK:

dahdi_class = class_create(“dahdi”);

Well, after two above changes- adding const to two functions and removing THIS_MODULE dahdi can be compiled and works at 5.14.0-427.13.1.el9_4.x86_64.

If someone runs quasar card- you need do the same change in it’s driver too…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.