problems creating a driver

David Sanán Baena (davidsanan@teleline.es)
Sun, 15 Dec 2002 14:05:47 +0100


Hello and before of all thank you for read this.

First I use kernel 2.4.9
I have made a driver to change data betwen kernel and user space.
but when compiling I got the following message:

[david@localhost samplepackage]# make
c++ -w -Wall -fno-exceptions -fno-rtti -fvtable-thunks -DHAVE_CONFIG_H -I. -
I. -I. -I/usr/local/include -I/usr/local/share/click/src -I/usr/src/linux/in
clude -MD -DCLICK_LINUXMODULE -DCLICK_PACKAGE -O2 -c totcl.cc -o totcl.ko
totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
totcl.cc:60: cannot convert `ssize_t (*) (file *, char *, unsigned int,
loff_t *)' to `module *' in initialization
totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
totcl.cc:60: cannot convert `int (*) (inode *, file *)' to `loff_t (*)
(file *, long long int, int)' in initialization
totcl.cc:60: sorry, not implemented: non-trivial labeled initializers
totcl.cc:60: cannot convert `int (*) (inode *, file *)' to `ssize_t (*)
(file *, char *, unsigned int, loff_t *)' in initialization
make: *** [totcl.ko] Error 1

my file_operations var is:
struct file_operations totcl_fops=
{
read:totcl_read,
open:totcl_open,
release:totcl_release,
};

(I have seen this in many documents, even in linux files...)

when I removed the labels the "sorry, not implementd:non-trivial labeled
initializers" is not shown
And finally looking in "/usr/src/linux/include/linxu/fs.h"
I saw that with the first field is: module * own
so I have changed my file_operations var to:

static struct file_operations totcl_fops=
{ NULL,
NULL, /*seek*/
totcl_read,
NULL, /*write*/
NULL, /* readdir*/
NULL, /* select */
NULL, /* ioctl */
NULL, /*mmap*/
totcl_open,
NULL, /*fflush*/
totcl_release
};
And now it compiles well... I have not test the result, but first I would
want to know why doesn't work the first declaration (when It must be work,
or not?).
Could I have any problems later because that?
Thanks In advance
David

-
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/