static struct pci_driver unknown field 'name' "has initializer but incomplete type"
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
make all
Building file: ../NHI_15504.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"NHI_15504.d" -MT"NHI_15504.d" -o"NHI_15504.o" "../NHI_15504.c"
In file included from ../NHI_15504.c:46:
/usr/src/kernels/2.6.27.21-170.2.56.fc10.i686/include/linux/mod_devicetable.h:310: error: ‘BITS_PER_LONG’ undeclared here (not in a function)
../NHI_15504.c:91: error: variable ‘NHI_15504_driver’ has initializer but incomplete type
../NHI_15504.c:92: error: unknown field ‘name’ specified in initializer
../NHI_15504.c:92: warning: excess elements in struct initializer
../NHI_15504.c:92: warning: (near initialization for ‘NHI_15504_driver’)
../NHI_15504.c:93: error: unknown field specified in initializer
../NHI_15504.c:93: warning: excess elements in struct initializer
../NHI_15504.c:93: warning: (near initialization for ‘NHI_15504_driver’)
../NHI_15504.c:94: error: unknown field ‘probe’ specified in initializer
../NHI_15504.c:94: warning: excess elements in struct initializer
../NHI_15504.c:94: warning: (near initialization for ‘NHI_15504_driver’)
../NHI_15504.c:95: error: unknown field ‘remove’ specified in initializer
../NHI_15504.c:95: warning: excess elements in struct initializer
../NHI_15504.c:95: warning: (near initialization for ‘NHI_15504_driver’)
../NHI_15504.c: In function ‘__init’:
../NHI_15504.c:115: warning: implicit declaration of function ‘pci_register_driver’
make: *** [NHI_15504.o] Error 1
Questions:
1) The Error
mod_devicetable.h:310: error: ‘BITS_PER_LONG’ undeclared here (not in a function)
The BITS_PER_LONG are define in file2alias.c as as result of
#if KERNEL_ELFCLASS == ELFCLASS32
(a) Where should KERNEL_ELFCLASS be #defined?
(b) Should it not be define already??
2) The Error
../NHI_15504.c:91: error: variable ‘NHI_15504_driver’ has initializer but incomplete type
(a) What am I missing in this struct declaration?
(b) Why are the fields 'name', ‘id_table’ 'probe" 'remove' unknown fields in this struct?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.