ERROR IN CHARACTER DRIVER PROGRAM
- From: "palli" <naveendavisv@xxxxxxxxx>
- Date: 26 Aug 2006 11:44:57 -0700
sir,
i can not compile the program given below
#include<linux/module.h>
#include<linux/fs.h>
static struct file_operations fops = {
open : NULL,
read : NULL,
write : NULL,
};
static char *name = "foo";
static int major;
int init_module(void){
major = register_chrdev( 0, name,&fops);
printk("registered =%d\n,major);
return 0;
}
void cleanup_module(void){
printk("cleaning ..\n");
unregister_chrdev(major,name);
}
i compiled using GCC
cc -c -O -DMODULE -D__KERNEL__module mo9.c -I/usr/linux -2.4.22
-1.2115.nptl/include
errors are mo9.c :5 variable 'fops' has intializer but incomplete
type
mo9.c :6 unknown field 'open' specifier in
intializer
mo9.c :7 unknown field 'read ' '' ''
mo9.c : 8 unknown field 'wrtie ' '''
''
mo9.c :5 storage size of 'fops' is not known
plz.help me
naveen davis
naveendavisv@xxxxxxxxx
.
- Prev by Date: Empty linux/config.h
- Next by Date: How to trace functions in a driver??
- Previous by thread: Empty linux/config.h
- Next by thread: How to trace functions in a driver??
- Index(es):