LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-16-2010, 09:31 AM   #1
liumeng
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Rep: Reputation: 0
Question variable `GPIO_LED_ctl_ops' has initializer but incomplete type


hello,everyone!
when i compile the device driver of led ,i get the erro like this:
[root@localhost led]# arm-linux-gcc -D__KERNEL__ -DMODULE -I /home/liumeng/lmldd
/linux-2.6.34.1/ -c -O -Wall led.c -o led.o
led.c:34: error: variable `GPIO_LED_ctl_ops' has initializer but incomplete type
led.c:36: error: unknown field `open' specified in initializer
led.c:36: error: `GPIO_LED_open' undeclared here (not in a function)
led.c:36: warning: excess elements in struct initializer
led.c:36: warning: (near initialization for `GPIO_LED_ctl_ops')
led.c:37: error: unknown field `read' specified in initializer
led.c:37: error: `GPIO_LED_read' undeclared here (not in a function)
led.c:37: warning: excess elements in struct initializer
led.c:37: warning: (near initialization for `GPIO_LED_ctl_ops')
led.c:38: error: unknown field `write' specified in initializer
led.c:38: error: `GPIO_LED_write' undeclared here (not in a function)
led.c:38: warning: excess elements in struct initializer
led.c:38: warning: (near initialization for `GPIO_LED_ctl_ops')
led.c:39: error: unknown field `ioctl' specified in initializer
led.c:39: error: `GPIO_LED_ioctl' undeclared here (not in a function)
led.c:39: warning: excess elements in struct initializer
led.c:39: warning: (near initialization for `GPIO_LED_ctl_ops')
led.c:40: error: unknown field `release' specified in initializer
led.c:40: error: `GPIO_LED_release' undeclared here (not in a function)
led.c:40: warning: excess elements in struct initializer
led.c:40: warning: (near initialization for `GPIO_LED_ctl_ops')
led.c:56: warning: "struct inode" declared inside parameter list
led.c:56: warning: its scope is only this definition or declaration, which is pr
obably not what you want
led.c: In function `GPIO_LED_ioctl':
led.c:60: warning: implicit declaration of function `S3C2410_GPIOREG'
led.c: At top level:
led.c:70: warning: "struct inode" declared inside parameter list
led.c: In function `GPIO_LED_open':
led.c:72: warning: `MOD_INC_USE_COUNT' is deprecated (declared at /usr/local/arm
/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/linux/module.h:
529)
led.c: At top level:
led.c:78: warning: "struct inode" declared inside parameter list
led.c: In function `GPIO_LED_release':
led.c:80: warning: `MOD_DEC_USE_COUNT' is deprecated (declared at /usr/local/arm
/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/sys-include/linux/module.h:
541)
led.c: In function `GPIO_LED_CTL_init':
led.c:103: warning: implicit declaration of function `devfs_register_chrdev'
led.c: In function `cleanup_GPIO_LED_ctl':
led.c:132: warning: implicit declaration of function `devfs_unregister_chrdev'
led.c: At top level:
led.c:34: error: storage size of `GPIO_LED_ctl_ops' isn't known



can anyone help me ??!!thank you !!
 
Old 09-17-2010, 09:48 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by liumeng View Post
hello,everyone!
when i compile the device driver of led ,i get the erro like this:
[root@localhost led]# arm-linux-gcc -D__KERNEL__ -DMODULE -I /home/liumeng/lmldd
/linux-2.6.34.1/ -c -O -Wall led.c -o led.o
led.c:34: error: variable `GPIO_LED_ctl_ops' has initializer but incomplete type

can anyone help me ??!!thank you !!
Based on your post, no. You give us no details (version/distro of Linux, what "LED" you're trying to work with, where you got the code, etc.

Based on what you've posted, the short answer is, you've got a problem in your code, fix it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
static struct pci_driver unknown field 'name' "has initializer but incomplete type" ddeeks Programming 0 05-27-2009 12:09 PM
error: variable ‘fops’ has initializer but incomplete type rajkumar_halle Programming 1 08-24-2008 08:57 AM
error: variable ‘scull_fops’ has initializer but incomplete type rajkumar_halle Programming 1 08-19-2008 12:51 AM
error :variable fops has initializer but incomplete type in compile device driver saffari62 Programming 1 04-06-2008 01:53 PM
arrays of elements with [gcc4]array type has incomplete element type lmmix Linux - Software 0 02-26-2005 08:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration