Здравствуйте. Есть такой проект virtual usb dirver https://github.com/linuxbuh/vhci_hcd.
Он без проблем собирается на ядрах от 5.х до 6.1. Однако на 6.6 завершается ошибкой:
/home/arch/abs/testing/vhci-hcd/src/build/vhci-hcd/1.15/build/usb-vhci-iocifc.c:1072:10: error: ‘struct class’ has no member named ‘owner’
1072 | .owner = THIS_MODULE,
| ^~~~~
In file included from ./include/linux/linkage.h:7,
from ./arch/x86/include/asm/cache.h:5,
from ./include/linux/cache.h:6,
from ./include/linux/time.h:5,
from ./include/linux/stat.h:19,
from ./include/linux/module.h:13:
./include/linux/export.h:29:21: error: initialization of ‘const char *’ from incompatible pointer type ‘struct module *’ [-Werror=incompatible-pointer-types]
29 | #define THIS_MODULE (&__this_module)
| ^
/home/arch/abs/testing/vhci-hcd/src/build/vhci-hcd/1.15/build/usb-vhci-iocifc.c:1072:18: note: in expansion of macro ‘THIS_MODULE’
1072 | .owner = THIS_MODULE,
| ^~~~~~~~~~~
./include/linux/export.h:29:21: note: (near initialization for ‘vhci_iocifc_class.name’)
29 | #define THIS_MODULE (&__this_module)
| ^
/home/arch/abs/testing/vhci-hcd/src/build/vhci-hcd/1.15/build/usb-vhci-iocifc.c:1072:18: note: in expansion of macro ‘THIS_MODULE’
1072 | .owner = THIS_MODULE,
| ^~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /home/arch/abs/testing/vhci-hcd/src/build/vhci-hcd/1.15/build/usb-vhci-iocifc.o] Error 1Вот кусок кода
static struct class vhci_iocifc_class = {
.owner = THIS_MODULE,
.name = driver_name
};#define CHARDEV_NAME "usb-vhci"
static struct device vhci_iocifc_device = {
.class = &vhci_iocifc_class,
.release = vhci_iocifc_device_release,
#ifndef NO_DEV_INIT_NAME
.init_name = CHARDEV_NAME,
#endif
.driver = &vhci_iocifc_driver.driver
};Как это исправить ?
> error: ‘struct class’ has no member named ‘owner’
> Как это исправить ?закомментируй owner
>> error: ‘struct class’ has no member named ‘owner’
>> Как это исправить ?
> закомментируй ownerПробовал уже... Появляется другая ошибка:
usb-vhci-iocifc.c: In function ‘ioc_register’:
./arch/x86/include/asm/uaccess.h:176:33: error: invalid initializer
176 | __typeof__(ptr) __ptr = (ptr); /* eval ptr once */ \
| ^
Нашёл...
кроме коммента .owner надо в функции ioc_register надо все __put_user заменить на put_user
Спасибо. Тему модно закрывать.