Find the answer to your Linux question:
Results 1 to 3 of 3
hi, the usb module is giving the following error.. cc module.c -o module module.c:53: error: variable `my_usb_driver' has initializer but incomplete type module.c:55: error: unknown field `name' specified in initializer ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2005
    Posts
    27

    error in compiling usb driver


    hi,
    the usb module is giving the following error..

    cc module.c -o module
    module.c:53: error: variable `my_usb_driver' has initializer but incomplete type
    module.c:55: error: unknown field `name' specified in initializer
    module.c:55: warning: excess elements in struct initializer
    module.c:55: warning: (near initialization for `my_usb_driver')
    module.c:56: error: unknown field `probe' specified in initializer
    module.c:56: warning: excess elements in struct initializer
    module.c:56: warning: (near initialization for `my_usb_driver')
    module.c:57: error: unknown field `disconnect' specified in initializer
    module.c:57: warning: excess elements in struct initializer
    module.c:57: warning: (near initialization for `my_usb_driver')
    module.c:53: error: storage size of `my_usb_driver' isn't known
    make: *** [module] Error 1

    i have checked all the structure usb_driver is there in the usb.h file in linux/usb.h

    my make file is as follows :-

    obj-m := module.o

    #KERNELDIR = /lib/modules/$(shell uname -r)/build
    KERNELDIR = /lib/modules/2.6.13.1/build
    #KERNELDIR = /usr/src/kernels/$(shell uname -r)/include
    PWD := $(shell pwd)

    default:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) module

  2. #2
    Just Joined!
    Join Date
    Jun 2006
    Posts
    15
    I can able to findout the solution, if u possible to give u'r source code....

  3. #3
    Linux User fernape's Avatar
    Join Date
    Dec 2005
    Location
    Holland
    Posts
    301
    Quote Originally Posted by recklinux
    module.c:53: error: variable `my_usb_driver' has initializer but incomplete type
    This often occurs when you use a structure as a type without a previous typedef, this is:

    struct my_struct;

    my_struct mi_var_struct;

    I think you're missing something like this.

    Best regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •