RE: skull_read (device driver) - incompatible pointer type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You are not using the right function decelerator.
Use the following declaration for read function:

	ssize_t (*read) (struct file *, char *, size_t, loff_t *);

Use this in definition and decleration of read function.

Regards,
Gaurav


-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx
[mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Shakthi Kannan
Sent: Thursday, August 05, 2004 4:24 PM
To: kernelnewbies@xxxxxxxxxxxx
Subject: skull_read (device driver) - incompatible pointer type

Greetings!

I am a new member and this is my first post.

I have written a sample device driver (on 2.6.5-mm1 kernel) and I am
getting this "read.c:45: warning: initialization from incompatible
pointer type" while compiling the code. Everything works in the code,
except the read function. The complete problem and code can be viewed
here:

http://www.linuxforum.com/forums/index.php?showtopic=87071

I have declared the skull_fops like this and the line 45 is the line
containing the "read: skull_read":

struct file_operations skull_fops = {
read: skull_read,
open: skull_open,
release: skull_release,
};

I have used the skull_read function like this:

int skull_read (struct inode *inode, struct file *file, char *buffer,
int count)

I would appreciate if you can tell me what is the error and how I can
get this working.

Thanks,

K Shakthi

-- 
Gentoo Linux 1.4 (2.6.5-mm1) / FreeBSD UNIX 4.9 on IBM Thinkpad T41
(Pentium M 1.40GHz-512 MB-40 GB).
Server:irc.freenode.net #linuxforum #linux-india #gentoo Nick:mbuf

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux