public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* required header files not #included in cdev.h
@ 2007-01-31  8:28 Daniel Rodrick
  2007-01-31  8:36 ` Robert P. J. Day
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Rodrick @ 2007-01-31  8:28 UTC (permalink / raw)
  To: kernelnewbies, linux-newbie

Hi,

This referes to the file include/linux/cdev.h whose contents are listed below:

#ifndef _LINUX_CDEV_H
#define _LINUX_CDEV_H
#ifdef __KERNEL__

struct cdev {
        struct kobject kobj;
        struct module *owner;
        const struct file_operations *ops;
        struct list_head list;
        dev_t dev;
        unsigned int count;
};

void cdev_init(struct cdev *, const struct file_operations *);

struct cdev *cdev_alloc(void);

void cdev_put(struct cdev *p);

int cdev_add(struct cdev *, dev_t, unsigned);

void cdev_del(struct cdev *);

void cd_forget(struct inode *);

#endif
#endif

It is a little strange to me that it uses certain kernel structure
types like kobject, module, list_head etc without #including
appropriate headers. The result is that when I try to use struct cdev
in my module by simply #including cdev.h, it flags an error. As a
result I need to manually figure out which all headers do I need to
(additionally) #include and in what order.

Is this OK?

Dan

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-31  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-31  8:28 required header files not #included in cdev.h Daniel Rodrick
2007-01-31  8:36 ` Robert P. J. Day
2007-01-31  9:26   ` Erik Mouw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox