lkml.org 
[lkml]   [2003]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Compilation Error: variable has intializer but incomplete type
From
Date
commence  Marcus Alanen quotation:

>>i am trying to learn and write device driver on linux kernel 2.4 redhat
>> distribution
>>
>>iam getting compilation errors for driver code.
>>struct file_operations my_ops ={NULL,my_read,my_write,NULL,NULL,NULL
>>NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
>>NULL };
>>
>>ERROR -> my_ops has intializer but incomplete type
>
> This is not a good way to do it. See e.g. fs/pipe.c#read_fifo_fops
> for an easier approach:
>
> struct file_operations read_fifo_fops = {
> llseek: no_llseek,
> read: pipe_read,
> write: bad_pipe_w,
> poll: fifo_poll,
> ioctl: pipe_ioctl,
> open: pipe_read_open,
> release: pipe_read_release,
> };

Aside from this, the main issue is the "has intializer but incomplete
type" error, which indicates that the definition of struct
file_operations has not been seen by the compiler. This seems to be
defined (in 2.4.20, at least) by include/linux/fs.h, so Raman will
need to #include that file for the initialization to work.

--
Sean Neakums - <sneakums@zork.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.054 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site