I created a header file for a driver module:
#ifndef __CHR_DRV__
#define __CHR_DRV__
#include <linux/cdev.h>
#define DEVICE_NAME "asic"
#define MODULE_NAME "CHR_DRV"
#define XXX_DEV_MAJOR_NO 210
typedef struct _tagDRV_STRUCT
{
int major_no;
struct cdev dev;//incomplete type.
char buffer[0x80];
}XXX_DEV;
extern XXX_DEV dev_info;
#endif
When compile this module, an error prompt: 'dev' has incomplete type.
I don't know why. The 'struct cdev' is defined in 'linux/cdev.h' . I am using the system GCC and the system kernel headers. But when I compile this module in your another version PCLinuxOS 2007 TR3, it is OK! Is this version of GCC in PCLinuxOS 2010.7 has some problems?